nus-yam/ex-repair huggingface dataset:
Program: 22483
Project: 22483
Buggy source:
public void updateEntity(){
  int[] target=getTarget(1);
  int x=target[0], y=yCoord, z=target[1];
  if (extendedTicks == 3 && this.worldObj.isRemote) {
    for (int i=0; i < 10; i++) {
    }
  }
  if (this.hasBlockUpdate && this.hasPartner()) {
    if (this.hasSomethingToSmash() && !this.isActive) {
      this.isActive=true;
      this.isBreaking=true;
    }
    this.hasBlockUpdate=false;
  }
 else   if (this.shouldStop) {
    this.spinup=0;
    this.extendedLength=0;
    this.extendedTicks=0;
    this.isActive=false;
  }
  if (this.isActive) {
    if (this.isBreaking) {
      if (this.spinup < 41) {
        if (this.spinup == 40) {
          this.smooshingBlock=worldObj.getBlock(x,y,z);
          this.smooshingMeta=worldObj.getBlockMetadata(x,y,z);
          worldObj.setBlockToAir(x,y,z);
        }
        this.spinup++;
      }
 else       if (this.extendedLength < 0.5F) {
        this.extendedLength+=0.1F;
        if (this.extendedTicks == 3) {
          spawnItems(x,y,z);
        }
        this.extendedTicks++;
      }
 else {
        this.isBreaking=false;
        this.spinup=0;
      }
    }
 else {
      if (this.extendedLength > 0.0F) {
        this.extendedLength-=0.025F;
        this.extendedTicks++;
        if (this.extendedLength < 0F)         this.extendedLength=0F;
      }
 else {
        this.isActive=false;
        this.extendedTicks=0;
      }
    }
    this.worldObj.markBlockForUpdate(xCoord,yCoord,zCoord);
  }
}

Fixed version (ground truth):
public void updateEntity(){
  int[] target=getTarget(1);
  int x=target[0], y=yCoord, z=target[1];
  if (extendedTicks == 3 && this.worldObj.isRemote) {
    for (int i=0; i < 10; i++) {
    }
  }
  if (this.hasBlockUpdate && this.hasPartner()) {
    if (this.hasSomethingToSmash() && !this.isActive) {
      this.isActive=true;
      this.isBreaking=true;
    }
    this.hasBlockUpdate=false;
  }
 else   if (this.shouldStop) {
    this.spinup=0;
    this.extendedLength=0;
    this.extendedTicks=0;
    this.isActive=false;
  }
  if (this.isActive) {
    if (this.isBreaking) {
      if (this.spinup < 41) {
        if (this.spinup == 40) {
          this.smooshingBlock=worldObj.getBlock(x,y,z);
          this.smooshingMeta=worldObj.getBlockMetadata(x,y,z);
          this.smooshedStack=new ItemStack(smooshingBlock.getItem(worldObj,x,y,z),1,smooshingMeta);
          worldObj.setBlockToAir(x,y,z);
        }
        this.spinup++;
      }
 else       if (this.extendedLength < 0.5F) {
        this.extendedLength+=0.1F;
        if (this.extendedTicks == 3) {
          if (this.getBlockMetadata() % 2 == 0 && !worldObj.isRemote)           spawnItems(x,y,z);
        }
        this.extendedTicks++;
      }
 else {
        this.isBreaking=false;
        this.spinup=0;
      }
    }
 else {
      if (this.extendedLength > 0.0F) {
        this.extendedLength-=0.025F;
        this.extendedTicks++;
        if (this.extendedLength < 0F)         this.extendedLength=0F;
      }
 else {
        this.isActive=false;
        this.extendedTicks=0;
      }
    }
    this.worldObj.markBlockForUpdate(xCoord,yCoord,zCoord);
  }
}
Program: 22484
Project: 22484
Buggy source:
private void decodeAndCreateParticles(int flags){
  if (worldObj.isRemote) {
    boolean smash=(flags & 1) == 1;
    boolean smoke1=((flags & 2) >> 1) == 1;
    boolean smoke2=((flags & 4) >> 2) == 1;
    boolean smoke3=((flags & 8) >> 3) == 1;
    int[] tgt=getTarget(1);
    int x=tgt[0], y=yCoord, z=tgt[1];
    if (smash) {
      System.out.println("String_Node_Str");
      worldObj.spawnParticle("String_Node_Str",x + 0.5D,y + 1D,z + 0.5D,(float)(Math.random() - 0.5F) / 3.0F,(float)(Math.random() - 0.5F) / 3.0F,(float)(Math.random() - 0.5F) / 3.0F);
      worldObj.spawnParticle("String_Node_Str",x + 0.5D,y + 1D,z + 0.5D,(float)(Math.random() - 0.5F) / 6.0F,(float)(Math.random() - 0.5F) / 6.0F,(float)(Math.random() - 0.5F) / 6.0F);
      worldObj.spawnParticle("String_Node_Str",x + 0.5D,y + 1D,z + 0.5D,(float)(Math.random() - 0.5F) / 12.0F,(float)(Math.random() - 0.5F) / 12.0F,(float)(Math.random() - 0.5F) / 12.0F);
    }
  }
}

Fixed version (ground truth):
private void decodeAndCreateParticles(int flags){
  if (worldObj.isRemote) {
    boolean smash=(flags & 1) == 1;
    boolean smoke1=((flags & 2) >> 1) == 1;
    boolean smoke2=((flags & 4) >> 2) == 1;
    boolean smoke3=((flags & 8) >> 3) == 1;
    int[] tgt=getTarget(1);
    int x=tgt[0], y=yCoord, z=tgt[1];
    if (smash) {
      System.out.println((float)(Math.random() - 0.5F) / 3.0F);
    }
    if (smoke1) {
      float xV=0F, zV=0F;
switch (getBlockMetadata()) {
case 2:
        zV=0.05F;
      break;
case 3:
    zV=-0.05F;
  break;
case 4:
xV=0.05F;
break;
case 5:
xV=-0.05F;
break;
default :
break;
}
worldObj.spawnParticle("String_Node_Str",xCoord + 0.5D,y + 1.1D,zCoord + 0.5D,xV,0.05F,zV);
}
}
}
Program: 22486
Project: 22486
Buggy source:
private int encodeParticles(){
  int smash=0, smoke1=0, smoke2=0, smoke3=0;
  if (!worldObj.isRemote) {
    if (extendedTicks == 3)     smash=1;
  }
  return smash + smoke1 + smoke2+ smoke3;
}

Fixed version (ground truth):
private int encodeParticles(){
  int smash=0, smoke1=0, smoke2=0, smoke3=0;
  if (!worldObj.isRemote) {
    if (extendedTicks == 3)     smash=1;
    if (extendedTicks >= 8 && extendedTicks <= 16 && (extendedTicks % 4) == 0)     smoke1=2;
  }
  return smash + smoke1 + smoke2+ smoke3;
}
Program: 22487
Project: 22487
Buggy source:
/** 
 * Draw the background layer for the GuiContainer (everything behind the items)
 */
protected void drawGuiContainerBackgroundLayer(float par1,int par2,int par3){
  GL11.glColor4f(1.0F,1.0F,1.0F,1.0F);
  this.mc.getTextureManager().bindTexture(furnaceGuiTextures);
  int k=(this.width - this.xSize) / 2;
  int l=(this.height - this.ySize) / 2;
  GL11.glEnable(3042);
  this.drawTexturedModalRect(k,l,0,0,this.xSize,this.ySize);
  int i1;
  i1=this.furnaceInventory.getBurnTimeRemainingScaled(14);
  this.drawTexturedModalRect(k + 58,l + 15 + 14 - i1,176,14 - i1,14,i1);
  GL11.glDisable(3042);
  float fill=(this.furnaceInventory.getTankInfo(ForgeDirection.UP)[0].fluid.amount / 10000.0F);
  drawFluid(new FluidStack(FluidRegistry.WATER,1),(int)(fill * 58.0F),k + 81,l + 14,16,58);
  this.mc.getTextureManager().bindTexture(furnaceGuiTextures);
  this.drawTexturedModalRect(k + 80,l + 13,190,0,18,60);
  fill=(float)this.furnaceInventory.steam / (float)this.furnaceInventory.getCapacity();
  FluidStack stack=new FluidStack(FluidRegistry.WATER,1);
  if (FluidRegistry.isFluidRegistered("String_Node_Str")) {
    stack=new FluidStack(FluidRegistry.getFluid("String_Node_Str"),1);
  }
  drawFluid(stack,(int)(fill * 58.0F),k + 104,l + 14,16,58);
  this.mc.getTextureManager().bindTexture(furnaceGuiTextures);
  this.drawTexturedModalRect(k + 103,l + 13,190,0,18,60);
  GL11.glDisable(3042);
}

Fixed version (ground truth):
/** 
 * Draw the background layer for the GuiContainer (everything behind the items)
 */
protected void drawGuiContainerBackgroundLayer(float par1,int par2,int par3){
  GL11.glColor4f(1.0F,1.0F,1.0F,1.0F);
  this.mc.getTextureManager().bindTexture(furnaceGuiTextures);
  int k=(this.width - this.xSize) / 2;
  int l=(this.height - this.ySize) / 2;
  GL11.glEnable(3042);
  this.drawTexturedModalRect(k,l,0,0,this.xSize,this.ySize);
  int i1;
  i1=this.furnaceInventory.getBurnTimeRemainingScaled(14);
  this.drawTexturedModalRect(k + 58,l + 15 + 14 - i1,176,14 - i1,14,i1);
  GL11.glDisable(3042);
  float fill=(this.furnaceInventory.getTankInfo(ForgeDirection.UP)[0].fluid.amount / 10000.0F);
  drawFluid(new FluidStack(FluidRegistry.WATER,1),(int)(fill * 58.0F),k + 81,l + 14,16,58);
  this.mc.getTextureManager().bindTexture(furnaceGuiTextures);
  this.drawTexturedModalRect(k + 80,l + 13,190,0,18,60);
  fill=(float)this.furnaceInventory.steam / (float)this.furnaceInventory.getCapacity();
  fill=Math.min(fill,1.0F);
  FluidStack stack=new FluidStack(FluidRegistry.WATER,1);
  if (FluidRegistry.isFluidRegistered("String_Node_Str")) {
    stack=new FluidStack(FluidRegistry.getFluid("String_Node_Str"),1);
  }
  drawFluid(stack,(int)(fill * 58.0F),k + 104,l + 14,16,58);
  this.mc.getTextureManager().bindTexture(furnaceGuiTextures);
  this.drawTexturedModalRect(k + 103,l + 13,190,0,18,60);
  GL11.glDisable(3042);
}
Program: 22488
Project: 22488
Buggy source:
@Override public void readFromNBT(NBTTagCompound par1NBTTagCompound){
  super.readFromNBT(par1NBTTagCompound);
  NBTTagList nbttaglist=(NBTTagList)par1NBTTagCompound.getTag("String_Node_Str");
  this.furnaceItemStacks=new ItemStack[this.getSizeInventory()];
  for (int i=0; i < nbttaglist.tagCount(); ++i) {
    NBTTagCompound nbttagcompound1=(NBTTagCompound)nbttaglist.getCompoundTagAt(i);
    byte b0=nbttagcompound1.getByte("String_Node_Str");
    if (b0 >= 0 && b0 < this.furnaceItemStacks.length) {
      this.furnaceItemStacks[b0]=ItemStack.loadItemStackFromNBT(nbttagcompound1);
    }
  }
  this.furnaceBurnTime=par1NBTTagCompound.getShort("String_Node_Str");
  this.furnaceCookTime=par1NBTTagCompound.getShort("String_Node_Str");
  if (par1NBTTagCompound.hasKey("String_Node_Str")) {
    this.field_145958_o=par1NBTTagCompound.getString("String_Node_Str");
  }
  if (par1NBTTagCompound.hasKey("String_Node_Str")) {
    this.myTank.setFluid(new FluidStack(FluidRegistry.WATER,par1NBTTagCompound.getShort("String_Node_Str")));
  }
  if (par1NBTTagCompound.hasKey("String_Node_Str")) {
    this.steam=par1NBTTagCompound.getShort("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void readFromNBT(NBTTagCompound par1NBTTagCompound){
  super.readFromNBT(par1NBTTagCompound);
  NBTTagList nbttaglist=(NBTTagList)par1NBTTagCompound.getTag("String_Node_Str");
  this.furnaceItemStacks=new ItemStack[this.getSizeInventory()];
  for (int i=0; i < nbttaglist.tagCount(); ++i) {
    NBTTagCompound nbttagcompound1=(NBTTagCompound)nbttaglist.getCompoundTagAt(i);
    byte b0=nbttagcompound1.getByte("String_Node_Str");
    if (b0 >= 0 && b0 < this.furnaceItemStacks.length) {
      this.furnaceItemStacks[b0]=ItemStack.loadItemStackFromNBT(nbttagcompound1);
    }
  }
  this.furnaceBurnTime=par1NBTTagCompound.getShort("String_Node_Str");
  this.furnaceCookTime=par1NBTTagCompound.getShort("String_Node_Str");
  this.currentItemBurnTime=par1NBTTagCompound.getShort("String_Node_Str");
  if (par1NBTTagCompound.hasKey("String_Node_Str")) {
    this.field_145958_o=par1NBTTagCompound.getString("String_Node_Str");
  }
  if (par1NBTTagCompound.hasKey("String_Node_Str")) {
    this.myTank.setFluid(new FluidStack(FluidRegistry.WATER,par1NBTTagCompound.getShort("String_Node_Str")));
  }
  if (par1NBTTagCompound.hasKey("String_Node_Str")) {
    this.steam=par1NBTTagCompound.getShort("String_Node_Str");
  }
}
Program: 22489
Project: 22489
Buggy source:
@Override public Packet getDescriptionPacket(){
  super.getDescriptionPacket();
  NBTTagCompound access=new NBTTagCompound();
  access.setInteger("String_Node_Str",steam);
  access.setInteger("String_Node_Str",myTank.getFluidAmount());
  access.setShort("String_Node_Str",(short)this.furnaceBurnTime);
  access.setShort("String_Node_Str",(short)this.furnaceCookTime);
  return new S35PacketUpdateTileEntity(xCoord,yCoord,zCoord,1,access);
}

Fixed version (ground truth):
@Override public Packet getDescriptionPacket(){
  super.getDescriptionPacket();
  NBTTagCompound access=new NBTTagCompound();
  access.setInteger("String_Node_Str",steam);
  access.setInteger("String_Node_Str",myTank.getFluidAmount());
  access.setShort("String_Node_Str",(short)this.furnaceBurnTime);
  access.setShort("String_Node_Str",(short)this.furnaceCookTime);
  access.setShort("String_Node_Str",(short)this.currentItemBurnTime);
  return new S35PacketUpdateTileEntity(xCoord,yCoord,zCoord,1,access);
}
Program: 22490
Project: 22490
Buggy source:
@Override public void onDataPacket(NetworkManager net,S35PacketUpdateTileEntity pkt){
  super.onDataPacket(net,pkt);
  NBTTagCompound access=pkt.func_148857_g();
  this.steam=access.getInteger("String_Node_Str");
  this.myTank.setFluid(new FluidStack(FluidRegistry.WATER,access.getInteger("String_Node_Str")));
  this.furnaceBurnTime=access.getShort("String_Node_Str");
  this.furnaceCookTime=access.getShort("String_Node_Str");
  worldObj.markBlockForUpdate(xCoord,yCoord,zCoord);
}

Fixed version (ground truth):
@Override public void onDataPacket(NetworkManager net,S35PacketUpdateTileEntity pkt){
  super.onDataPacket(net,pkt);
  NBTTagCompound access=pkt.func_148857_g();
  this.steam=access.getInteger("String_Node_Str");
  this.myTank.setFluid(new FluidStack(FluidRegistry.WATER,access.getInteger("String_Node_Str")));
  this.furnaceBurnTime=access.getShort("String_Node_Str");
  this.currentItemBurnTime=access.getShort("String_Node_Str");
  this.furnaceCookTime=access.getShort("String_Node_Str");
  worldObj.markBlockForUpdate(xCoord,yCoord,zCoord);
}
Program: 22491
Project: 22491
Buggy source:
@Override public void writeToNBT(NBTTagCompound par1NBTTagCompound){
  super.writeToNBT(par1NBTTagCompound);
  par1NBTTagCompound.setShort("String_Node_Str",(short)this.furnaceBurnTime);
  par1NBTTagCompound.setShort("String_Node_Str",(short)myTank.getFluidAmount());
  par1NBTTagCompound.setShort("String_Node_Str",(short)this.steam);
  par1NBTTagCompound.setShort("String_Node_Str",(short)this.furnaceCookTime);
  NBTTagList nbttaglist=new NBTTagList();
  for (int i=0; i < this.furnaceItemStacks.length; ++i) {
    if (this.furnaceItemStacks[i] != null) {
      NBTTagCompound nbttagcompound1=new NBTTagCompound();
      nbttagcompound1.setByte("String_Node_Str",(byte)i);
      this.furnaceItemStacks[i].writeToNBT(nbttagcompound1);
      nbttaglist.appendTag(nbttagcompound1);
    }
  }
  par1NBTTagCompound.setTag("String_Node_Str",nbttaglist);
  if (this.hasCustomInventoryName()) {
    par1NBTTagCompound.setString("String_Node_Str",this.field_145958_o);
  }
}

Fixed version (ground truth):
@Override public void writeToNBT(NBTTagCompound par1NBTTagCompound){
  super.writeToNBT(par1NBTTagCompound);
  par1NBTTagCompound.setShort("String_Node_Str",(short)this.furnaceBurnTime);
  par1NBTTagCompound.setShort("String_Node_Str",(short)myTank.getFluidAmount());
  par1NBTTagCompound.setShort("String_Node_Str",(short)this.steam);
  par1NBTTagCompound.setShort("String_Node_Str",(short)this.furnaceCookTime);
  par1NBTTagCompound.setShort("String_Node_Str",(short)this.currentItemBurnTime);
  NBTTagList nbttaglist=new NBTTagList();
  for (int i=0; i < this.furnaceItemStacks.length; ++i) {
    if (this.furnaceItemStacks[i] != null) {
      NBTTagCompound nbttagcompound1=new NBTTagCompound();
      nbttagcompound1.setByte("String_Node_Str",(byte)i);
      this.furnaceItemStacks[i].writeToNBT(nbttagcompound1);
      nbttaglist.appendTag(nbttagcompound1);
    }
  }
  par1NBTTagCompound.setTag("String_Node_Str",nbttaglist);
  if (this.hasCustomInventoryName()) {
    par1NBTTagCompound.setString("String_Node_Str",this.field_145958_o);
  }
}
Program: 22496
Project: 22496
Buggy source:
@Override protected void onCreate(Bundle tableSex){
  super.onCreate(tableSex);
  setContentView(R.layout.activity_list_songs);
  songListView=(ListView)findViewById(R.id.activity_list_songs_list);
  Intent intent=getIntent();
  Bundle bundle=intent.getExtras();
  if (bundle == null)   throw new RuntimeException("String_Node_Str");
  currentArtist=(String)bundle.get("String_Node_Str");
  if (currentArtist == null || currentArtist.isEmpty())   throw new RuntimeException("String_Node_Str");
  this.setTitle(currentArtist);
  if ((kMP.musicList != null) && (!kMP.musicList.isEmpty())) {
    items=kMP.songs.getAlbumsByArtist(currentArtist);
    items.add(0,getString(R.string.all_songs));
    final ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,items);
    songListView.setAdapter(adapter);
    songListView.setOnItemClickListener(this);
  }
  ActionBar actionBar=getActionBar();
  actionBar.setDisplayHomeAsUpEnabled(true);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle tableSex){
  super.onCreate(tableSex);
  setContentView(R.layout.activity_list_songs);
  songListView=(ListView)findViewById(R.id.activity_list_songs_list);
  Intent intent=getIntent();
  Bundle bundle=intent.getExtras();
  if (bundle == null)   throw new RuntimeException("String_Node_Str");
  currentArtist=(String)bundle.get("String_Node_Str");
  if (currentArtist == null || currentArtist.isEmpty())   throw new RuntimeException("String_Node_Str");
  this.setTitle(currentArtist);
  items=kMP.songs.getAlbumsByArtist(currentArtist);
  items.add(0,getString(R.string.all_songs));
  final ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,items);
  songListView.setAdapter(adapter);
  songListView.setOnItemClickListener(this);
  ActionBar actionBar=getActionBar();
  actionBar.setDisplayHomeAsUpEnabled(true);
}
Program: 22497
Project: 22497
Buggy source:
/** 
 * Will be called when the music completes - either when the user presses 'next' or when the music ends or when the user selects another track.
 */
@Override public void onCompletion(MediaPlayer mp){
  serviceState=ServiceState.Playing;
  if (player.getCurrentPosition() <= 0)   return;
  broadcastCurrentState(ServicePlayMusic.BROADCAST_EXTRA_COMPLETED);
  if (repeatMode) {
    playSong();
    return;
  }
  next(false);
  if (kMP.musicService.currentSongPosition == 0) {
    if (kMP.settings.get("String_Node_Str",false))     playSong();
 else {
      stopSelf();
      currentSong=null;
    }
    return;
  }
  playSong();
}

Fixed version (ground truth):
/** 
 * Will be called when the music completes - either when the user presses 'next' or when the music ends or when the user selects another track.
 */
@Override public void onCompletion(MediaPlayer mp){
  serviceState=ServiceState.Playing;
  broadcastCurrentState(ServicePlayMusic.BROADCAST_EXTRA_COMPLETED);
  if (repeatMode) {
    playSong();
    return;
  }
  next(false);
  if (kMP.musicService.currentSongPosition == 0) {
    if (kMP.settings.get("String_Node_Str",false))     playSong();
 else     destroySelf();
    return;
  }
  playSong();
}
Program: 22498
Project: 22498
Buggy source:
/** 
 * Jumps to the next song on the list.
 * @note Remember to call `playSong()` to make the MusicPlayeractually play the music.
 */
public void next(){
  scrobbleCurrentSong(false);
  if (shuffleMode) {
    int newSongPosition=currentSongPosition;
    while (newSongPosition == currentSongPosition)     newSongPosition=random.nextInt(songs.size());
    currentSongPosition=newSongPosition;
    return;
  }
  currentSongPosition++;
  if (currentSongPosition >= songs.size())   currentSongPosition=0;
  kMP.nowPlayingIndex=currentSongPosition;
}

Fixed version (ground truth):
/** 
 * Jumps to the next song on the list.
 * @note Remember to call `playSong()` to make the MusicPlayeractually play the music.
 */
public void next(){
  scrobbleCurrentSong(false);
  if (shuffleMode) {
    int newSongPosition=currentSongPosition;
    while (newSongPosition == currentSongPosition)     newSongPosition=random.nextInt(songs.size());
    currentSongPosition=newSongPosition;
    return;
  }
  currentSongPosition++;
  if (currentSongPosition >= songs.size())   currentSongPosition=0;
}
Program: 22499
Project: 22499
Buggy source:
/** 
 * Let's call this when the user selects a song from the list.
 * @param songIndex FUCK YEAH
 */
public void setSong(int songIndex){
  currentSongPosition=songIndex;
}

Fixed version (ground truth):
/** 
 * Sets a specific song, already within internal Now Playing List.
 * @param songIndex Index of the song inside the Now Playing List.
 */
public void setSong(int songIndex){
  if (songIndex < 0 || songIndex >= songs.size())   currentSongPosition=0;
  currentSongPosition=songIndex;
}
Program: 22500
Project: 22500
Buggy source:
@Override public boolean onError(MediaPlayer mp,int what,int extra){
  mp.reset();
  return false;
}

Fixed version (ground truth):
/** 
 * If something wrong happens with the MusicPlayer.
 */
@Override public boolean onError(MediaPlayer mp,int what,int extra){
  mp.reset();
  return false;
}
Program: 22501
Project: 22501
Buggy source:
public void previous(){
  scrobbleCurrentSong(false);
  currentSongPosition--;
  if (currentSongPosition < 0)   currentSongPosition=songs.size() - 1;
  kMP.nowPlayingIndex=currentSongPosition;
  playSong();
}

Fixed version (ground truth):
/** 
 * Jumps to the previous song on the list.
 * @note Remember to call `playSong()` to make the MusicPlayeractually play the music.
 */
public void previous(){
  scrobbleCurrentSong(false);
  currentSongPosition--;
  if (currentSongPosition < 0)   currentSongPosition=songs.size() - 1;
}
Program: 22502
Project: 22502
Buggy source:
/** 
 * When the user selects an item from our list, we'll start playing. We'll play the current list, starting from the song the user just selected.
 */
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  kMP.nowPlayingList=kMP.musicList;
  kMP.nowPlayingIndex=position;
  startActivity(new Intent(this,ActivityNowPlaying.class));
}

Fixed version (ground truth):
/** 
 * When the user selects an item from our list, we'll start playing. We'll play the current list, starting from the song the user just selected.
 */
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  kMP.nowPlayingList=kMP.musicList;
  Intent intent=new Intent(this,ActivityNowPlaying.class);
  intent.putExtra("String_Node_Str",position);
  startActivity(intent);
}
Program: 22503
Project: 22503
Buggy source:
/** 
 * Called when the activity is created for the first time.
 */
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_menu_albums);
  ActionBar actionBar=getActionBar();
  actionBar.setDisplayHomeAsUpEnabled(true);
  listView=(ListView)findViewById(R.id.activity_menu_albums_list);
  items=kMP.songs.getAlbums();
  final ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,items);
  listView.setAdapter(adapter);
  listView.setOnItemClickListener(this);
}

Fixed version (ground truth):
/** 
 * Called when the activity is created for the first time.
 */
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_menu_albums);
  ActionBar actionBar=getActionBar();
  if (actionBar != null)   actionBar.setDisplayHomeAsUpEnabled(true);
  listView=(ListView)findViewById(R.id.activity_menu_albums_list);
  items=kMP.songs.getAlbums();
  final ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,items);
  listView.setAdapter(adapter);
  listView.setOnItemClickListener(this);
}
Program: 22504
Project: 22504
Buggy source:
private void endStatefulConnection(){
  try {
    jcoContext.end(destination);
  }
 catch (  JCoException e) {
    throw new HibersapException("String_Node_Str",e);
  }
 finally {
    destination=null;
  }
}

Fixed version (ground truth):
private void endStatefulConnection(){
  try {
    jcoContext.end(destination);
  }
 catch (  JCoException e) {
    LOG.warn("String_Node_Str",e);
  }
 finally {
    destination=null;
  }
}
Program: 22505
Project: 22505
Buggy source:
public void close(){
  endStatefulConnection();
}

Fixed version (ground truth):
public void close(){
  if (destination != null) {
    endStatefulConnection();
  }
}
Program: 22506
Project: 22506
Buggy source:
private void assertConversionExceptionToJava(Object value){
  try {
    converter.convertToJava(value);
    fail();
  }
 catch (  ConversionException e) {
  }
}

Fixed version (ground truth):
private void assertConversionExceptionToJava(String value){
  try {
    converter.convertToJava(value);
    fail();
  }
 catch (  ConversionException e) {
  }
}
Program: 22507
Project: 22507
Buggy source:
@Test public void testConvertToSap(){
  assertEquals("String_Node_Str",converter.convertToSap(true));
  assertEquals("String_Node_Str",converter.convertToSap(false));
  assertConversionExceptionToSap(null);
  assertConversionExceptionToSap(new Integer(0));
}

Fixed version (ground truth):
@Test public void testConvertToSap(){
  assertEquals("String_Node_Str",converter.convertToSap(true));
  assertEquals("String_Node_Str",converter.convertToSap(false));
  assertConversionExceptionToSap(null);
}
Program: 22508
Project: 22508
Buggy source:
private void assertConversionExceptionToSap(Object value){
  try {
    converter.convertToSap(value);
    fail();
  }
 catch (  ConversionException e) {
  }
}

Fixed version (ground truth):
private void assertConversionExceptionToSap(Boolean value){
  try {
    converter.convertToSap(value);
    fail();
  }
 catch (  ConversionException e) {
  }
}
Program: 22509
Project: 22509
Buggy source:
@Test public void testConvertToJava(){
  assertEquals(true,converter.convertToJava("String_Node_Str"));
  assertEquals(true,converter.convertToJava("String_Node_Str"));
  assertEquals(true,converter.convertToJava("String_Node_Str"));
  assertEquals(false,converter.convertToJava("String_Node_Str"));
  assertEquals(false,converter.convertToJava("String_Node_Str"));
  assertConversionExceptionToJava("String_Node_Str");
  assertConversionExceptionToJava(null);
  assertConversionExceptionToJava(new Integer(0));
}

Fixed version (ground truth):
@Test public void testConvertToJava(){
  assertEquals(true,converter.convertToJava("String_Node_Str"));
  assertEquals(true,converter.convertToJava("String_Node_Str"));
  assertEquals(true,converter.convertToJava("String_Node_Str"));
  assertEquals(false,converter.convertToJava("String_Node_Str"));
  assertEquals(false,converter.convertToJava("String_Node_Str"));
  assertConversionExceptionToJava("String_Node_Str");
  assertConversionExceptionToJava(null);
}
Program: 22510
Project: 22510
Buggy source:
@Test public void testConvertToJava(){
  assertEquals(' ',converter.convertToJava(null));
  assertEquals(' ',converter.convertToJava("String_Node_Str"));
  assertEquals('A',converter.convertToJava("String_Node_Str"));
  assertEquals('A',converter.convertToJava("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testConvertToJava(){
  assertEquals((Object)' ',converter.convertToJava(null));
  assertEquals((Object)' ',converter.convertToJava("String_Node_Str"));
  assertEquals((Object)'A',converter.convertToJava("String_Node_Str"));
  assertEquals((Object)'A',converter.convertToJava("String_Node_Str"));
}
Program: 22511
Project: 22511
Buggy source:
private static void activateBeanValidationWithTypeSafeActivator(Set<BapiInterceptor> bapiInterceptors,SessionManagerConfig sessionManagerConfig){
  try {
    Class<?> activator=ReflectionHelper.getClassForName(TYPE_SAFE_ACTIVATOR_CLASS_NAME);
    Method activateBeanValidation=activator.getDeclaredMethod(TYPE_SAFE_ACTIVATOR_METHOD_NAME,Set.class,SessionManagerConfig.class);
    activateBeanValidation.setAccessible(true);
    activateBeanValidation.invoke(null,bapiInterceptors,sessionManagerConfig);
  }
 catch (  ClassNotFoundException e) {
    throw new HibersapException("String_Node_Str" + TYPE_SAFE_ACTIVATOR_CLASS_NAME,e);
  }
catch (  InvocationTargetException e) {
    throw new HibersapException("String_Node_Str" + TYPE_SAFE_ACTIVATOR_METHOD_NAME + "String_Node_Str"+ TYPE_SAFE_ACTIVATOR_CLASS_NAME,e);
  }
catch (  NoSuchMethodException e) {
    throw new HibersapException("String_Node_Str" + TYPE_SAFE_ACTIVATOR_METHOD_NAME + "String_Node_Str"+ TYPE_SAFE_ACTIVATOR_CLASS_NAME,e);
  }
catch (  IllegalAccessException e) {
    throw new HibersapException("String_Node_Str" + TYPE_SAFE_ACTIVATOR_METHOD_NAME + "String_Node_Str"+ TYPE_SAFE_ACTIVATOR_CLASS_NAME,e);
  }
}

Fixed version (ground truth):
private static void activateBeanValidationWithTypeSafeActivator(Set<BapiInterceptor> bapiInterceptors,SessionManagerConfig sessionManagerConfig){
  try {
    Class<?> activator=ReflectionHelper.getClassForName(TYPE_SAFE_ACTIVATOR_CLASS_NAME);
    Method activateBeanValidation=activator.getDeclaredMethod(TYPE_SAFE_ACTIVATOR_METHOD_NAME,Set.class,SessionManagerConfig.class);
    activateBeanValidation.invoke(null,bapiInterceptors,sessionManagerConfig);
  }
 catch (  ClassNotFoundException e) {
    throw new HibersapException("String_Node_Str" + TYPE_SAFE_ACTIVATOR_CLASS_NAME,e);
  }
catch (  InvocationTargetException e) {
    throw new HibersapException("String_Node_Str" + TYPE_SAFE_ACTIVATOR_METHOD_NAME + "String_Node_Str"+ TYPE_SAFE_ACTIVATOR_CLASS_NAME,e);
  }
catch (  NoSuchMethodException e) {
    throw new HibersapException("String_Node_Str" + TYPE_SAFE_ACTIVATOR_METHOD_NAME + "String_Node_Str"+ TYPE_SAFE_ACTIVATOR_CLASS_NAME,e);
  }
catch (  IllegalAccessException e) {
    throw new HibersapException("String_Node_Str" + TYPE_SAFE_ACTIVATOR_METHOD_NAME + "String_Node_Str"+ TYPE_SAFE_ACTIVATOR_CLASS_NAME,e);
  }
}
Program: 22512
Project: 22512
Buggy source:
private static void activateBeanValidationWithTypeSafeActivator(Set<BapiInterceptor> bapiInterceptors,SessionManagerConfig sessionManagerConfig){
  try {
    Class<?> activator=ReflectionHelper.getClassForName(TYPE_SAFE_ACTIVATOR_CLASS_NAME);
    Method activateBeanValidation=activator.getDeclaredMethod(TYPE_SAFE_ACTIVATOR_METHOD_NAME,Set.class,SessionManagerConfig.class);
    activateBeanValidation.invoke(null,bapiInterceptors,sessionManagerConfig);
  }
 catch (  ClassNotFoundException e) {
    throw new HibersapException("String_Node_Str" + TYPE_SAFE_ACTIVATOR_CLASS_NAME,e);
  }
catch (  InvocationTargetException e) {
    throw new HibersapException("String_Node_Str" + TYPE_SAFE_ACTIVATOR_METHOD_NAME + "String_Node_Str"+ TYPE_SAFE_ACTIVATOR_CLASS_NAME,e);
  }
catch (  NoSuchMethodException e) {
    throw new HibersapException("String_Node_Str" + TYPE_SAFE_ACTIVATOR_METHOD_NAME + "String_Node_Str"+ TYPE_SAFE_ACTIVATOR_CLASS_NAME,e);
  }
catch (  IllegalAccessException e) {
    throw new HibersapException("String_Node_Str" + TYPE_SAFE_ACTIVATOR_METHOD_NAME + "String_Node_Str"+ TYPE_SAFE_ACTIVATOR_CLASS_NAME,e);
  }
}

Fixed version (ground truth):
private static void activateBeanValidationWithTypeSafeActivator(Set<BapiInterceptor> bapiInterceptors,SessionManagerConfig sessionManagerConfig){
  try {
    Class<?> activator=ReflectionHelper.getClassForName(TYPE_SAFE_ACTIVATOR_CLASS_NAME);
    Method activateBeanValidation=activator.getDeclaredMethod(TYPE_SAFE_ACTIVATOR_METHOD_NAME,Set.class,SessionManagerConfig.class);
    activateBeanValidation.setAccessible(true);
    activateBeanValidation.invoke(null,bapiInterceptors,sessionManagerConfig);
  }
 catch (  ClassNotFoundException e) {
    throw new HibersapException("String_Node_Str" + TYPE_SAFE_ACTIVATOR_CLASS_NAME,e);
  }
catch (  InvocationTargetException e) {
    throw new HibersapException("String_Node_Str" + TYPE_SAFE_ACTIVATOR_METHOD_NAME + "String_Node_Str"+ TYPE_SAFE_ACTIVATOR_CLASS_NAME,e);
  }
catch (  NoSuchMethodException e) {
    throw new HibersapException("String_Node_Str" + TYPE_SAFE_ACTIVATOR_METHOD_NAME + "String_Node_Str"+ TYPE_SAFE_ACTIVATOR_CLASS_NAME,e);
  }
catch (  IllegalAccessException e) {
    throw new HibersapException("String_Node_Str" + TYPE_SAFE_ACTIVATOR_METHOD_NAME + "String_Node_Str"+ TYPE_SAFE_ACTIVATOR_CLASS_NAME,e);
  }
}
Program: 22513
Project: 22513
Buggy source:
private void unregister(List<AnnotationConfiguration> annotationConfigurations){
  try {
    InitialContext ic=new InitialContext();
    try {
      for (      AnnotationConfiguration annotationConfiguration : annotationConfigurations) {
        ic.unbind("String_Node_Str" + annotationConfiguration.getSessionManagerConfig().getName());
      }
    }
  finally {
      ic.close();
    }
  }
 catch (  NamingException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private void unregister(List<AnnotationConfiguration> annotationConfigurations){
  try {
    InitialContext ic=new InitialContext();
    try {
      for (      AnnotationConfiguration annotationConfiguration : annotationConfigurations) {
        ic.unbind("String_Node_Str" + annotationConfiguration.getSessionManagerName());
      }
    }
  finally {
      ic.close();
    }
  }
 catch (  NamingException e) {
    throw new RuntimeException(e);
  }
}
Program: 22514
Project: 22514
Buggy source:
private void register(List<AnnotationConfiguration> annotationConfigurations){
  try {
    InitialContext ic=new InitialContext();
    try {
      ic.lookup("String_Node_Str");
    }
 catch (    NameNotFoundException e) {
      ic.createSubcontext("String_Node_Str");
    }
    Context context=(Context)ic.lookup("String_Node_Str");
    ClassLoader old=Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader(cl);
    try {
      for (      AnnotationConfiguration annotationConfig : annotationConfigurations) {
        context.bind(annotationConfig.getSessionManagerConfig().getName(),annotationConfig.buildSessionManager());
      }
    }
  finally {
      Thread.currentThread().setContextClassLoader(old);
      ic.close();
    }
  }
 catch (  NamingException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private void register(List<AnnotationConfiguration> annotationConfigurations){
  try {
    InitialContext ic=new InitialContext();
    try {
      ic.lookup("String_Node_Str");
    }
 catch (    NameNotFoundException e) {
      ic.createSubcontext("String_Node_Str");
    }
    Context context=(Context)ic.lookup("String_Node_Str");
    ClassLoader old=Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader(cl);
    try {
      for (      AnnotationConfiguration annotationConfig : annotationConfigurations) {
        SessionManager sessionManager=annotationConfig.buildSessionManager();
        context.bind(sessionManager.getConfig().getName(),sessionManager);
      }
    }
  finally {
      Thread.currentThread().setContextClassLoader(old);
      ic.close();
    }
  }
 catch (  NamingException e) {
    throw new RuntimeException(e);
  }
}
Program: 22515
Project: 22515
Buggy source:
public static Set<ExecutionInterceptor> createExecutionInterceptors(SessionManagerConfig sessionManagerConfig){
  final Set<String> classNames=sessionManagerConfig.getExecutionInterceptorClasses();
  final Set<ExecutionInterceptor> executionInterceptors=new HashSet<ExecutionInterceptor>();
  executionInterceptors.addAll(createInstances(classNames,ExecutionInterceptor.class));
  executionInterceptors.add(new SapErrorInterceptor());
  return executionInterceptors;
}

Fixed version (ground truth):
public static Set<ExecutionInterceptor> createExecutionInterceptors(SessionManagerConfig sessionManagerConfig){
  final List<String> classNames=sessionManagerConfig.getExecutionInterceptorClasses();
  final Set<ExecutionInterceptor> executionInterceptors=new HashSet<ExecutionInterceptor>();
  executionInterceptors.addAll(createInstances(classNames,ExecutionInterceptor.class));
  executionInterceptors.add(new SapErrorInterceptor());
  return executionInterceptors;
}
Program: 22516
Project: 22516
Buggy source:
public static Set<BapiInterceptor> createBapiInterceptors(SessionManagerConfig sessionManagerConfig){
  final Set<String> classNames=sessionManagerConfig.getBapiInterceptorClasses();
  final Set<BapiInterceptor> bapiInterceptors=new HashSet<BapiInterceptor>();
  bapiInterceptors.addAll(createInstances(classNames,BapiInterceptor.class));
  activateBeanValidation(bapiInterceptors,sessionManagerConfig);
  return bapiInterceptors;
}

Fixed version (ground truth):
public static Set<BapiInterceptor> createBapiInterceptors(SessionManagerConfig sessionManagerConfig){
  final List<String> classNames=sessionManagerConfig.getBapiInterceptorClasses();
  final Set<BapiInterceptor> bapiInterceptors=new HashSet<BapiInterceptor>();
  bapiInterceptors.addAll(createInstances(classNames,BapiInterceptor.class));
  activateBeanValidation(bapiInterceptors,sessionManagerConfig);
  return bapiInterceptors;
}
Program: 22517
Project: 22517
Buggy source:
@XmlElement(name="String_Node_Str",required=true,namespace=HibersapConfig.NAMESPACE) public List<SessionManagerConfig> getSessionManagers(){
  return sessionManagers;
}

Fixed version (ground truth):
public List<SessionManagerConfig> getSessionManagers(){
  return sessionManagers;
}
Program: 22518
Project: 22518
Buggy source:
@SuppressWarnings("String_Node_Str") private void mapFields(Set<? extends ParameterMapping> set,JCoParameterList jcoParams){
  JCoParameterFieldIterator iter=jcoParams.getParameterFieldIterator();
  while (iter.hasNextField()) {
    JCoField field=iter.nextField();
    ParameterMapping param=getParameterMapping(field);
    if (ParameterMapping.ParamType.FIELD == param.getParamType()) {
      ((Set<FieldMapping>)set).add((FieldMapping)param);
    }
 else     if (ParameterMapping.ParamType.STRUCTURE == param.getParamType()) {
      ((Set<StructureMapping>)set).add((StructureMapping)param);
    }
 else     if (ParameterMapping.ParamType.TABLE == param.getParamType()) {
      ((Set<TableMapping>)set).add((TableMapping)param);
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void mapFields(Set<? extends ParameterMapping> set,JCoParameterList jcoParams){
  if (jcoParams == null) {
    return;
  }
  JCoParameterFieldIterator iter=jcoParams.getParameterFieldIterator();
  while (iter.hasNextField()) {
    JCoField field=iter.nextField();
    ParameterMapping param=getParameterMapping(field);
    if (ParameterMapping.ParamType.FIELD == param.getParamType()) {
      ((Set<FieldMapping>)set).add((FieldMapping)param);
    }
 else     if (ParameterMapping.ParamType.STRUCTURE == param.getParamType()) {
      ((Set<StructureMapping>)set).add((StructureMapping)param);
    }
 else     if (ParameterMapping.ParamType.TABLE == param.getParamType()) {
      ((Set<TableMapping>)set).add((TableMapping)param);
    }
  }
}
Program: 22519
Project: 22519
Buggy source:
@SuppressWarnings("String_Node_Str") static void activateBeanValidation(Set<BapiInterceptor> bapiInterceptors,SessionManagerConfig sessionManagerConfig){
  try {
    ValidatorFactory factory=validatorFactoryFactory.buildValidatorFactory();
    bapiInterceptors.add(new BeanValidationInterceptor(factory));
  }
 catch (  ValidationException e) {
    if (sessionManagerConfig.getValidationMode() == ValidationMode.AUTO) {
      LOGGER.warn("String_Node_Str" + "String_Node_Str" + "String_Node_Str",e);
    }
 else {
      throw new HibersapException("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") static void activateBeanValidation(Set<BapiInterceptor> bapiInterceptors,SessionManagerConfig sessionManagerConfig){
  try {
    ValidatorFactory factory=validatorFactoryFactory.buildValidatorFactory();
    bapiInterceptors.add(new BeanValidationInterceptor(factory));
  }
 catch (  ValidationException e) {
    ValidationMode validationMode=sessionManagerConfig.getValidationMode();
    if (validationMode == ValidationMode.AUTO) {
      LOGGER.warn("String_Node_Str" + "String_Node_Str" + "String_Node_Str",e);
    }
 else {
      throw new HibersapException("String_Node_Str" + validationMode,e);
    }
  }
}
Program: 22520
Project: 22520
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  Property other=(Property)obj;
  if (name == null) {
    if (other.name != null)     return false;
  }
 else   if (!name.equals(other.name))   return false;
  if (value == null) {
    if (other.value != null)     return false;
  }
 else   if (!value.equals(other.value))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(final Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  final Property other=(Property)obj;
  if (name == null) {
    if (other.name != null) {
      return false;
    }
  }
 else   if (!name.equals(other.name)) {
    return false;
  }
  if (value == null) {
    if (other.value != null) {
      return false;
    }
  }
 else   if (!value.equals(other.value)) {
    return false;
  }
  return true;
}
Program: 22521
Project: 22521
Buggy source:
@Test public void testEmptyInputRecordCausesError() throws Exception {
  final MappedRecord resultRecord=_service.getFlightList(new MappedRecordImpl("String_Node_Str"));
  assertNotNull(resultRecord);
  final MappedRecord returnRecord=(MappedRecord)resultRecord.get(BapiConstants.RETURN);
  assertNotNull(returnRecord);
  final String type=(String)returnRecord.get(BapiConstants.TYPE);
  assertEquals("String_Node_Str",type);
}

Fixed version (ground truth):
public void testEmptyInputRecordCausesError() throws Exception {
  final MappedRecord resultRecord=_service.getFlightList(new MappedRecordImpl("String_Node_Str"));
  assertNotNull(resultRecord);
  final MappedRecord returnRecord=(MappedRecord)resultRecord.get(BapiConstants.RETURN);
  assertNotNull(returnRecord);
  final String type=(String)returnRecord.get(BapiConstants.TYPE);
  assertEquals("String_Node_Str",type);
}
Program: 22522
Project: 22522
Buggy source:
@BeforeClass public static void setUp() throws Exception {
  final Context naming=new InitialContext();
  _service=(RAConnectorService)naming.lookup(RAConnectorService.JNDI_NAME);
  assertNotNull(_service);
  naming.close();
}

Fixed version (ground truth):
public static void setUp() throws Exception {
  final Context naming=new InitialContext();
  _service=(RAConnectorService)naming.lookup(RAConnectorService.JNDI_NAME);
  assertNotNull(_service);
  naming.close();
}
Program: 22523
Project: 22523
Buggy source:
@Test public void testFlightList() throws Exception {
  final MappedRecord resultRecord=_service.getFlightList(createInputRecord());
  assertNotNull(resultRecord);
  final MappedRecord returnRecord=(MappedRecord)resultRecord.get(BapiConstants.RETURN);
  assertNotNull(returnRecord);
  final String type=(String)returnRecord.get(BapiConstants.TYPE);
  assertEquals(returnRecord.toString(),"String_Node_Str",type);
  final IndexedRecord tableDataRecord=(IndexedRecord)resultRecord.get(FlightListConstants.FLIGHTLIST);
  assertNotNull(tableDataRecord);
  assertEquals(2,tableDataRecord.size());
  MappedRecord rowRecord=(MappedRecord)tableDataRecord.get(0);
  String connid=(String)rowRecord.get(FlightListConstants.CONNID);
  assertEquals("String_Node_Str",connid);
  rowRecord=(MappedRecord)tableDataRecord.get(1);
  connid=(String)rowRecord.get(FlightListConstants.CONNID);
  assertEquals("String_Node_Str",connid);
}

Fixed version (ground truth):
public void testFlightList() throws Exception {
  final MappedRecord resultRecord=_service.getFlightList(createInputRecord());
  assertNotNull(resultRecord);
  final MappedRecord returnRecord=(MappedRecord)resultRecord.get(BapiConstants.RETURN);
  assertNotNull(returnRecord);
  final String type=(String)returnRecord.get(BapiConstants.TYPE);
  assertEquals(returnRecord.toString(),"String_Node_Str",type);
  final IndexedRecord tableDataRecord=(IndexedRecord)resultRecord.get(FlightListConstants.FLIGHTLIST);
  assertNotNull(tableDataRecord);
  assertEquals(2,tableDataRecord.size());
  MappedRecord rowRecord=(MappedRecord)tableDataRecord.get(0);
  String connid=(String)rowRecord.get(FlightListConstants.CONNID);
  assertEquals("String_Node_Str",connid);
  rowRecord=(MappedRecord)tableDataRecord.get(1);
  connid=(String)rowRecord.get(FlightListConstants.CONNID);
  assertEquals("String_Node_Str",connid);
}
Program: 22524
Project: 22524
Buggy source:
@BeforeClass public static void setUp() throws Exception {
  final Context naming=new InitialContext();
  _service=(SapFlightService)naming.lookup(SapFlightService.JNDI_NAME);
  assertNotNull(_service);
  naming.close();
}

Fixed version (ground truth):
public static void setUp() throws Exception {
  final Context naming=new InitialContext();
  _service=(SapFlightService)naming.lookup(SapFlightService.JNDI_NAME);
  assertNotNull(_service);
  naming.close();
}
Program: 22525
Project: 22525
Buggy source:
@Test public void testFlightDetails() throws Exception {
  final Date date26Apr2002=new GregorianCalendar(2002,Calendar.APRIL,26).getTime();
  final FlightDetailBapi flightDetail=_service.showFlightDetail(date26Apr2002);
  showResult(flightDetail);
}

Fixed version (ground truth):
public void testFlightDetails() throws Exception {
  final Date date26Apr2002=new GregorianCalendar(2002,Calendar.APRIL,26).getTime();
  final FlightDetailBapi flightDetail=_service.showFlightDetail(date26Apr2002);
  showResult(flightDetail);
}
Program: 22526
Project: 22526
Buggy source:
@Test public void testFlightList() throws Exception {
  final FlightListBapi flightList=_service.showFlightList();
  showResult(flightList);
}

Fixed version (ground truth):
public void testFlightList() throws Exception {
  final FlightListBapi flightList=_service.showFlightList();
  showResult(flightList);
}
Program: 22527
Project: 22527
Buggy source:
private Properties convertToProperties(final HiberSap hiberSapConfig){
  final Properties properties=new Properties();
  final SessionFactory sessionFactory=hiberSapConfig.getSessionFactory();
  properties.setProperty(Environment.SESSION_FACTORY_NAME,sessionFactory.getName());
  properties.setProperty(Environment.CONTEXT_CLASS,sessionFactory.getContext());
  final List<String> annotatedClasses=sessionFactory.getClasses();
  final Iterator<String> classesIterator=annotatedClasses.iterator();
  for (int idx=0; idx < annotatedClasses.size(); idx++) {
    properties.setProperty(Environment.BABI_CLASSES_PREFIX + idx,classesIterator.next());
  }
  final List<JCoProperty> jcoProperties=sessionFactory.getJCoProperties();
  for (  final JCoProperty jCoProperty : jcoProperties) {
    properties.setProperty(JCoContext.HIBERSAP_JCO_PREFIX + jCoProperty.getName(),jCoProperty.getValue());
  }
  return properties;
}

Fixed version (ground truth):
private Properties convertToProperties(final HiberSap hiberSapConfig){
  final Properties properties=new Properties();
  final SessionFactory sessionFactory=hiberSapConfig.getSessionFactory();
  properties.setProperty(Environment.SESSION_FACTORY_NAME,sessionFactory.getName());
  properties.setProperty(Environment.CONTEXT_CLASS,sessionFactory.getContext());
  final List<String> annotatedClasses=sessionFactory.getClasses();
  final Iterator<String> classesIterator=annotatedClasses.iterator();
  for (int idx=0; idx < annotatedClasses.size(); idx++) {
    properties.setProperty(Environment.BABI_CLASSES_PREFIX + idx,classesIterator.next());
  }
  final List<JCoProperty> jcoProperties=sessionFactory.getJCoProperties();
  for (  final JCoProperty jCoProperty : jcoProperties) {
    properties.setProperty(JCoContext.HIBERSAP_JCO_PREFIX + "String_Node_Str" + jCoProperty.getName(),jCoProperty.getValue());
  }
  return properties;
}