nus-yam/ex-repair huggingface dataset:
Program: 169520
Project: 169520
Buggy source:
@Override public boolean onItemUse(ItemStack par1ItemStack,EntityPlayer par2EntityPlayer,World par3World,int posX,int posY,int posZ,int par7,float par8,float par9,float par10){
  if (par2EntityPlayer.isSneaking()) {
    return false;
  }
  IInventory seedBagInventory=InventoryItem.getItemInventory(par2EntityPlayer,par2EntityPlayer.getCurrentEquippedItem(),"String_Node_Str",9);
  seedBagInventory.openInventory();
  ItemStack seed=getSeedType(par1ItemStack);
  if (seed != null && seed.getItem() instanceof IPlantable) {
    IPlantable plant=(IPlantable)seed.getItem();
    for (int modX=-2; modX < 3; modX++) {
      for (int modZ=-2; modZ < 3; modZ++) {
        Block b=par3World.getBlock(posX + modX,posY,posZ + modZ);
        if (b.canSustainPlant(par3World,posX,posY,posZ,ForgeDirection.UP,plant) && par3World.isAirBlock(posX + modX,posY + 1,posZ + modZ)) {
          for (int i=0; i < seedBagInventory.getSizeInventory(); i++) {
            ItemStack is=seedBagInventory.getStackInSlot(i);
            if (is != null) {
              seedBagInventory.decrStackSize(i,1);
              par3World.setBlock(posX + modX,posY + 1,posZ + modZ,plant.getPlant(par3World,posX + modX,posY + 1,posZ + modZ),plant.getPlantMetadata(par3World,posX + modX,posY + 1,modZ + modZ),0x3);
              break;
            }
          }
        }
      }
    }
    return true;
  }
  seedBagInventory.closeInventory();
  return false;
}

Fixed version (ground truth):
@Override public boolean onItemUse(ItemStack par1ItemStack,EntityPlayer par2EntityPlayer,World par3World,int posX,int posY,int posZ,int par7,float par8,float par9,float par10){
  if (par2EntityPlayer.isSneaking()) {
    return false;
  }
  IInventory seedBagInventory=InventoryItem.getItemInventory(par2EntityPlayer,par2EntityPlayer.getCurrentEquippedItem(),"String_Node_Str",9);
  seedBagInventory.openInventory();
  ItemStack seed=getSeedType(par1ItemStack);
  if (seed != null && seed.getItem() instanceof IPlantable) {
    IPlantable plant=(IPlantable)seed.getItem();
    for (int modX=-2; modX < 3; modX++) {
      for (int modZ=-2; modZ < 3; modZ++) {
        Block b=par3World.getBlock(posX + modX,posY,posZ + modZ);
        if (b.canSustainPlant(par3World,posX,posY,posZ,ForgeDirection.UP,plant) && par3World.isAirBlock(posX + modX,posY + 1,posZ + modZ)) {
          for (int i=0; i < seedBagInventory.getSizeInventory(); i++) {
            ItemStack is=seedBagInventory.getStackInSlot(i);
            if (is != null) {
              Item item=is.getItem();
              item.onItemUse(is,par2EntityPlayer,par3World,posX + modX,posY,posZ + modZ,par7,par8 + modX,par9,par10 + modZ);
              seedBagInventory.decrStackSize(i,0);
              break;
            }
          }
        }
      }
    }
    return true;
  }
  seedBagInventory.closeInventory();
  return false;
}
Program: 169521
Project: 169521
Buggy source:
/** 
 * Callback for when the crafting matrix is changed.
 */
@Override public void onCraftMatrixChanged(IInventory p_75130_1_){
  if (craftingGrid != null)   projectTable.craftResult.setInventorySlotContents(0,CraftingManager.getInstance().findMatchingRecipe(craftingGrid,projectTable.getWorldObj()));
}

Fixed version (ground truth):
/** 
 * Callback for when the crafting matrix is changed.
 */
@Override public void onCraftMatrixChanged(IInventory p_75130_1_){
  if (craftingGrid != null)   craftResult.setInventorySlotContents(0,CraftingManager.getInstance().findMatchingRecipe(craftingGrid,projectTable.getWorldObj()));
}
Program: 169522
Project: 169522
Buggy source:
public ContainerProjectTable(InventoryPlayer invPlayer,TileProjectTable projectTable){
  this.projectTable=projectTable;
  craftingGrid=projectTable.getCraftingGrid(this);
  for (int i=0; i < 3; ++i) {
    for (int j=0; j < 3; ++j) {
      addSlotToContainer(new Slot(craftingGrid,j + i * 3,34 + j * 18,16 + i * 18));
    }
  }
  addSlotToContainer(new SlotProjectTableCrafting(projectTable,invPlayer.player,craftingGrid,projectTable.craftResult,0,127,34));
  for (int i=0; i < 2; ++i) {
    for (int j=0; j < 9; ++j) {
      addSlotToContainer(new Slot(projectTable,j + i * 9,8 + j * 18,79 + i * 18));
    }
  }
  bindPlayerInventory(invPlayer);
}

Fixed version (ground truth):
public ContainerProjectTable(InventoryPlayer invPlayer,TileProjectTable projectTable){
  this.projectTable=projectTable;
  craftingGrid=projectTable.getCraftingGrid(this);
  for (int i=0; i < 3; ++i) {
    for (int j=0; j < 3; ++j) {
      addSlotToContainer(new Slot(craftingGrid,j + i * 3,34 + j * 18,16 + i * 18));
    }
  }
  addSlotToContainer(new SlotProjectTableCrafting(projectTable,invPlayer.player,craftingGrid,craftResult,0,127,34));
  for (int i=0; i < 2; ++i) {
    for (int j=0; j < 9; ++j) {
      addSlotToContainer(new Slot(projectTable,j + i * 9,8 + j * 18,79 + i * 18));
    }
  }
  bindPlayerInventory(invPlayer);
}
Program: 169523
Project: 169523
Buggy source:
@SideOnly(Side.CLIENT) public void renderBox(int minx,int miny,int minz,int maxx,int maxy,int maxz);

Fixed version (ground truth):
@SideOnly(Side.CLIENT) public void renderBox(int minx,int miny,int minz,int maxx,int maxy,int maxz,int textureSize);
Program: 169524
Project: 169524
Buggy source:
@Override public final int getWeakOutput(ForgeDirection side){
  RedstoneConnection con=getConnection(side);
  if (con == null)   return 0;
  ForgeDirection face=ForgeDirection.getOrientation(getFace()).getOpposite();
  int p=RedstoneHelper.setOutput(getWorld(),getX(),getY(),getZ(),side,face,con.getPower());
  return con.isOutput() ? p : 0;
}

Fixed version (ground truth):
@Override public final int getWeakOutput(ForgeDirection side){
  RedstoneConnection con=getConnection(side);
  if (con == null)   return 0;
  ForgeDirection face=ForgeDirection.getOrientation(getFace()).getOpposite();
  int p=RedstoneHelper.setOutput(getWorld(),getX(),getY(),getZ(),side,face,con.getPower());
  return con.isOutput() ? p : 5;
}
Program: 169525
Project: 169525
Buggy source:
@Override public final int getStrongOutput(ForgeDirection side){
  return getWeakOutput(side);
}

Fixed version (ground truth):
@Override public final int getStrongOutput(ForgeDirection side){
  return 0;
}
Program: 169527
Project: 169527
Buggy source:
/** 
 * TESR 
 */
@Override public void renderTileEntityAt(TileEntity te,double x,double y,double z,float f){
  if (pass != 0) {
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit,240f,240f);
    int power=((TileLamp)te).getPower();
    BlockLamp bLamp=(BlockLamp)te.getBlockType();
    int redMask=0xFF0000, greenMask=0xFF00, blueMask=0xFF;
    int r=(bLamp.getColor() & redMask) >> 16;
    int g=(bLamp.getColor() & greenMask) >> 8;
    int b=(bLamp.getColor() & blueMask);
    if (bLamp.isInverted()) {
      power=15 - power;
    }
    Vector3Cube vector=new Vector3Cube(0.0,0.0,0.0,1.0,1.0,1.0);
    GL11.glTranslated(x,y,z);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDepthMask(false);
    GL11.glBegin(GL11.GL_QUADS);
    double powerDivision=(power / 15D);
    RenderHelper.drawColoredCube(vector.clone().expand(0.8 / 16D),r / 256D,g / 256D,b / 256D,powerDivision * 0.625D);
    GL11.glEnd();
    GL11.glDepthMask(true);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glTranslated(-x,-y,-z);
  }
}

Fixed version (ground truth):
/** 
 * TESR 
 */
@Override public void renderTileEntityAt(TileEntity te,double x,double y,double z,float f){
  if (pass != 0) {
    int power=((TileLamp)te).getPower();
    BlockLamp bLamp=(BlockLamp)te.getBlockType();
    int redMask=0xFF0000, greenMask=0xFF00, blueMask=0xFF;
    int r=(bLamp.getColor() & redMask) >> 16;
    int g=(bLamp.getColor() & greenMask) >> 8;
    int b=(bLamp.getColor() & blueMask);
    if (bLamp.isInverted()) {
      power=15 - power;
    }
    Vector3Cube vector=new Vector3Cube(0.0,0.0,0.0,1.0,1.0,1.0);
    GL11.glTranslated(x,y,z);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDepthMask(false);
    GL11.glBegin(GL11.GL_QUADS);
    double powerDivision=(power / 15D);
    RenderHelper.drawColoredCube(vector.clone().expand(0.8 / 16D),r / 256D,g / 256D,b / 256D,powerDivision * 0.625D);
    GL11.glEnd();
    GL11.glDepthMask(true);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glTranslated(-x,-y,-z);
  }
}
Program: 169528
Project: 169528
Buggy source:
@Override public void addOcclusionBoxes(List<AxisAlignedBB> boxes){
}

Fixed version (ground truth):
@Override public void addOcclusionBoxes(List<AxisAlignedBB> boxes){
  boxes.add(OCCLUSION_BOX.clone().toAABB());
}
Program: 169531
Project: 169531
Buggy source:
@Override public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer player,int par6,float par7,float par8,float par9){
  if (player.isSneaking()) {
    return false;
  }
  TileEntity entity=world.getTileEntity(x,y,z);
  if (entity == null || !(entity instanceof TileBase)) {
    return false;
  }
  if (getGuiID() != GuiIDs.INVALID) {
    player.openGui(BluePower.instance,getGuiID().ordinal(),world,x,y,z);
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer player,int par6,float par7,float par8,float par9){
  if (player.isSneaking()) {
    if (player.getHeldItem() != null) {
      if (player.getHeldItem().getItem() == BPItems.screwdriver) {
        return false;
      }
    }
  }
  if (player.isSneaking()) {
    return false;
  }
  TileEntity entity=world.getTileEntity(x,y,z);
  if (entity == null || !(entity instanceof TileBase)) {
    return false;
  }
  if (getGuiID() != GuiIDs.INVALID) {
    player.openGui(BluePower.instance,getGuiID().ordinal(),world,x,y,z);
    return true;
  }
  return false;
}
Program: 169532
Project: 169532
Buggy source:
@Override public boolean onItemUseFirst(ItemStack stack,EntityPlayer player,World world,int x,int y,int z,int side,float hitX,float hitY,float hitZ){
  Block block=world.getBlock(x,y,z);
  if (block == BPBlocks.multipart) {
    IMultipartCompat compat=(IMultipartCompat)CompatibilityUtils.getModule(Dependencies.FMP);
    BPPart p=compat.getClickedPart(new Vector3(x,y,z,world),new Vector3(hitX,hitY,hitZ),player,null);
    if (p != null && player.isSneaking()) {
      p.onActivated(player,new MovingObjectPosition(x,y,z,side,Vec3.createVectorHelper(x + hitX,y + hitY,z + hitZ)),stack);
    }
    return false;
  }
  TileEntity te=world.getTileEntity(x,y,z);
  if (te != null && te instanceof IRedBusWindow && player.isSneaking() && !(te instanceof TileCPU)) {
    player.openGui(BluePower.instance,GuiIDs.REDBUS_ID.ordinal(),world,x,y,z);
  }
  block.rotateBlock(world,x,y,z,ForgeDirection.getOrientation(side));
  if (!player.capabilities.isCreativeMode) {
    stack.setItemDamage(stack.getItemDamage() + 1);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onItemUseFirst(ItemStack stack,EntityPlayer player,World world,int x,int y,int z,int side,float hitX,float hitY,float hitZ){
  Block block=world.getBlock(x,y,z);
  if (block == BPBlocks.multipart) {
    IMultipartCompat compat=(IMultipartCompat)CompatibilityUtils.getModule(Dependencies.FMP);
    BPPart p=compat.getClickedPart(new Vector3(x,y,z,world),new Vector3(hitX,hitY,hitZ),player,null);
    if (p != null && player.isSneaking()) {
      p.onActivated(player,new MovingObjectPosition(x,y,z,side,Vec3.createVectorHelper(x + hitX,y + hitY,z + hitZ)),stack);
    }
    return false;
  }
  TileEntity te=world.getTileEntity(x,y,z);
  if (te != null && te instanceof IRedBusWindow && player.isSneaking() && !(te instanceof TileCPU)) {
    player.openGui(BluePower.instance,GuiIDs.REDBUS_ID.ordinal(),world,x,y,z);
  }
  if (block instanceof BlockContainerBase) {
    if (((BlockContainerBase)block).getGuiID() != GuiIDs.INVALID) {
      if (player.isSneaking()) {
        block.rotateBlock(world,x,y,z,ForgeDirection.getOrientation(side));
        if (!player.capabilities.isCreativeMode) {
          stack.setItemDamage(stack.getItemDamage() + 1);
        }
      }
    }
 else {
      block.rotateBlock(world,x,y,z,ForgeDirection.getOrientation(side));
      if (!player.capabilities.isCreativeMode) {
        stack.setItemDamage(stack.getItemDamage() + 1);
      }
    }
  }
 else {
    block.rotateBlock(world,x,y,z,ForgeDirection.getOrientation(side));
    if (!player.capabilities.isCreativeMode) {
      stack.setItemDamage(stack.getItemDamage() + 1);
    }
  }
  return false;
}
Program: 169533
Project: 169533
Buggy source:
public static ItemStack getItemForPart(String id,int stacksize){
  if (parts.containsKey(id)) {
    ItemStack is=new ItemStack(BPItems.multipart);
    NBTTagCompound tag=new NBTTagCompound();
    tag.setString("String_Node_Str",id);
    is.setTagCompound(tag);
    is.stackSize=stacksize;
    return is;
  }
  return null;
}

Fixed version (ground truth):
public static ItemStack getItemForPart(String id,int stacksize){
  if (parts.containsKey(id)) {
    ItemStack is=new ItemStack(BPItems.multipart);
    NBTTagCompound tag=new NBTTagCompound();
    tag.setString("String_Node_Str",id);
    is.setTagCompound(tag);
    is.stackSize=stacksize;
    is.setItemDamage(getStackMetadata(is));
    return is;
  }
  return null;
}
Program: 169534
Project: 169534
Buggy source:
@Override public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer,int par2){
  ItemStack itemstack=null;
  Slot slot=(Slot)this.inventorySlots.get(par2);
  if (slot != null && slot.getHasStack()) {
    ItemStack itemstack1=slot.getStack();
    itemstack=itemstack1.copy();
    if (par2 < 27) {
      if (!this.mergeItemStack(itemstack1,27,63,true)) {
        return null;
      }
    }
 else     if (!this.mergeItemStack(itemstack1,0,27,false)) {
      return null;
    }
    if (itemstack1.stackSize == 0) {
      slot.putStack((ItemStack)null);
    }
 else {
      slot.onSlotChanged();
    }
    if (itemstack1.stackSize == itemstack.stackSize) {
      return null;
    }
    slot.onPickupFromSlot(par1EntityPlayer,itemstack1);
  }
  return itemstack;
}

Fixed version (ground truth):
@Override public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer,int par2){
  ItemStack itemstack=null;
  Slot slot=(Slot)inventorySlots.get(par2);
  if (slot != null && slot.getHasStack()) {
    ItemStack itemstack1=slot.getStack();
    itemstack=itemstack1.copy();
    if (par2 < 27) {
      if (!mergeItemStack(itemstack1,27,63,true)) {
        return null;
      }
    }
 else     if (!mergeItemStack(itemstack1,0,27,false)) {
      return null;
    }
    if (itemstack1.stackSize == 0) {
      slot.putStack((ItemStack)null);
    }
 else {
      slot.onSlotChanged();
    }
    if (itemstack1.stackSize == itemstack.stackSize) {
      return null;
    }
    slot.onPickupFromSlot(par1EntityPlayer,itemstack1);
  }
  return itemstack;
}
Program: 169535
Project: 169535
Buggy source:
public ContainerCanvasBag(ItemStack bag,IInventory playerInventory,IInventory canvasBagInventory){
  this.bag=bag;
  int i=-1 * 18;
  canvasBagInventory.openInventory();
  for (int j=0; j < 3; ++j) {
    for (int k=0; k < 9; ++k) {
      this.addSlotToContainer(new SlotExclude(canvasBagInventory,k + j * 9,8 + k * 18,18 + j * 18,BPItems.canvas_bag));
    }
  }
  for (int j=0; j < 3; ++j) {
    for (int k=0; k < 9; ++k) {
      this.addSlotToContainer(new Slot(playerInventory,k + j * 9 + 9,8 + k * 18,103 + j * 18 + i));
    }
  }
  for (int j=0; j < 9; ++j) {
    if (playerInventory.getStackInSlot(j) == ((InventoryItem)canvasBagInventory).getItem()) {
      this.addSlotToContainer(new SlotLocked(playerInventory,j,8 + j * 18,161 + i));
    }
 else {
      this.addSlotToContainer(new Slot(playerInventory,j,8 + j * 18,161 + i));
    }
    this.addSlotToContainer(new Slot(playerInventory,j,8 + j * 18,161 + i));
  }
  this.canvasBagInventory=canvasBagInventory;
}

Fixed version (ground truth):
public ContainerCanvasBag(ItemStack bag,IInventory playerInventory,IInventory canvasBagInventory){
  this.bag=bag;
  int i=-1 * 18;
  canvasBagInventory.openInventory();
  for (int j=0; j < 3; ++j) {
    for (int k=0; k < 9; ++k) {
      addSlotToContainer(new SlotExclude(canvasBagInventory,k + j * 9,8 + k * 18,18 + j * 18,BPItems.canvas_bag));
    }
  }
  for (int j=0; j < 3; ++j) {
    for (int k=0; k < 9; ++k) {
      addSlotToContainer(new Slot(playerInventory,k + j * 9 + 9,8 + k * 18,103 + j * 18 + i));
    }
  }
  for (int j=0; j < 9; ++j) {
    if (playerInventory.getStackInSlot(j) == ((InventoryItem)canvasBagInventory).getItem()) {
      addSlotToContainer(new SlotLocked(playerInventory,j,8 + j * 18,161 + i));
    }
 else {
      addSlotToContainer(new Slot(playerInventory,j,8 + j * 18,161 + i));
    }
    addSlotToContainer(new Slot(playerInventory,j,8 + j * 18,161 + i));
  }
  this.canvasBagInventory=canvasBagInventory;
}
Program: 169537
Project: 169537
Buggy source:
private void addOreToGenerate(int veinCount,int veinSize,int minY,int maxY,Block block,World world,int chunkX,int chunkZ){
  Random rand=new Random(Integer.valueOf(chunkX).hashCode() + Integer.valueOf(chunkZ).hashCode());
  for (int i=0; i < veinCount; i++) {
    int x=chunkX * 16 + rand.nextInt(16);
    int y=rand.nextInt(maxY - minY) + minY;
    int z=chunkZ * 16 + rand.nextInt(16);
    (new WorldGenMinable(block,veinSize)).generate(world,rand,x,y,z);
  }
}

Fixed version (ground truth):
private void addOreToGenerate(Random random,int veinCount,int veinSize,int minY,int maxY,Block block,World world,int chunkX,int chunkZ){
  for (int i=0; i < veinCount; i++) {
    int x=chunkX * 16 + random.nextInt(16);
    int y=random.nextInt(maxY - minY) + minY;
    int z=chunkZ * 16 + random.nextInt(16);
    (new WorldGenMinable(block,veinSize)).generate(world,random,x,y,z);
  }
}
Program: 169539
Project: 169539
Buggy source:
/** 
 * Can this block stay at this position.  Similar to canPlaceBlockAt except gets checked often with plants.
 */
@Override public boolean canBlockStay(World world,int x,int y,int z){
  if (world.getBlock(x,y,z) != this)   return super.canBlockStay(world,x,y,z);
  if ((world.getBlock(x,y - 1,z) instanceof BlockFarmland) || (world.getBlock(x,y - 1,z) instanceof BlockCrop)) {
    return true;
  }
 else   return false;
}

Fixed version (ground truth):
/** 
 * Can this block stay at this position.  Similar to canPlaceBlockAt except gets checked often with plants.
 */
@Override public boolean canBlockStay(World world,int x,int y,int z){
  if (world.getBlock(x,y,z) != this)   return super.canBlockStay(world,x,y,z);
  return (world.getBlock(x,y - 1,z) instanceof BlockFarmland) || (world.getBlock(x,y - 1,z) instanceof BlockCrop);
}
Program: 169542
Project: 169542
Buggy source:
private void generateLavaColumn(World world,int x,int topY,int z,Random rand){
  if (rand.nextDouble() < Config.volcanoActiveToInactiveRatio) {
    world.setBlock(x,topY,z,BPBlocks.cracked_basalt);
  }
 else {
    world.setBlock(x,topY + 1,z,Blocks.lava);
    world.setBlock(x,topY,z,Blocks.lava);
  }
  for (int y=10; y < topY; y++) {
    world.setBlock(x + 1,y,z,BPBlocks.basalt,0,0);
    world.setBlock(x - 1,y,z,BPBlocks.basalt,0,0);
    world.setBlock(x,y,z + 1,BPBlocks.basalt,0,0);
    world.setBlock(x,y,z - 1,BPBlocks.basalt,0,0);
    world.setBlock(x,y,z,Blocks.lava,0,0);
  }
}

Fixed version (ground truth):
private void generateLavaColumn(World world,int x,int topY,int z,Random rand){
  if (rand.nextDouble() < Config.volcanoActiveToInactiveRatio) {
    world.setBlock(x,topY,z,BPBlocks.cracked_basalt);
  }
 else {
    world.setBlock(x,topY + 1,z,Blocks.lava);
    world.setBlock(x,topY,z,Blocks.lava);
  }
  for (int y=topY - 1; y >= 10; y--) {
    world.setBlock(x + 1,y,z,BPBlocks.basalt,0,0);
    world.setBlock(x - 1,y,z,BPBlocks.basalt,0,0);
    world.setBlock(x,y,z + 1,BPBlocks.basalt,0,0);
    world.setBlock(x,y,z - 1,BPBlocks.basalt,0,0);
    world.setBlock(x,y,z,Blocks.lava,0,0);
  }
}
Program: 169543
Project: 169543
Buggy source:
private void generateLavaColumn(World world,int x,int topY,int z,Random rand){
  if (rand.nextDouble() < Config.volcanoActiveToInactiveRatio) {
    world.setBlock(x,topY,z,BPBlocks.cracked_basalt);
  }
 else {
    world.setBlock(x,topY + 1,z,Blocks.lava);
    world.setBlock(x,topY,z,Blocks.lava);
  }
  for (int y=10; y < topY; y++) {
    world.setBlock(x,y,z,Blocks.lava,0,0);
    world.setBlock(x + 1,y,z,BPBlocks.basalt,0,0);
    world.setBlock(x - 1,y,z,BPBlocks.basalt,0,0);
    world.setBlock(x,y,z + 1,BPBlocks.basalt,0,0);
    world.setBlock(x,y,z - 1,BPBlocks.basalt,0,0);
  }
}

Fixed version (ground truth):
private void generateLavaColumn(World world,int x,int topY,int z,Random rand){
  if (rand.nextDouble() < Config.volcanoActiveToInactiveRatio) {
    world.setBlock(x,topY,z,BPBlocks.cracked_basalt);
  }
 else {
    world.setBlock(x,topY + 1,z,Blocks.lava);
    world.setBlock(x,topY,z,Blocks.lava);
  }
  for (int y=10; y < topY; y++) {
    world.setBlock(x + 1,y,z,BPBlocks.basalt,0,0);
    world.setBlock(x - 1,y,z,BPBlocks.basalt,0,0);
    world.setBlock(x,y,z + 1,BPBlocks.basalt,0,0);
    world.setBlock(x,y,z - 1,BPBlocks.basalt,0,0);
    world.setBlock(x,y,z,Blocks.lava,0,0);
  }
}
Program: 169544
Project: 169544
Buggy source:
public void generate(World world,Random rand,int middleX,int vulcanoHeight,int middleZ){
  List<Pos>[] distMap=calculateDistMap();
  boolean first=true;
  for (int dist=0; dist < distMap.length; dist++) {
    List<Pos> distList=distMap[dist];
    boolean isFinished=true;
    for (    Pos p : distList) {
      int worldHeight=world.getHeightValue(p.x + middleX,p.z + middleZ) - 1;
      int posHeight=first ? vulcanoHeight : getNewVulcanoHeight(worldHeight,p,rand,dist);
      if (posHeight >= 0 && (posHeight > worldHeight || canReplace(world,p.x + middleX,posHeight,p.z + middleZ))) {
        vulcanoMap.put(p,posHeight);
        if (!first) {
          for (int i=posHeight; i > 0 && (i > worldHeight || canReplace(world,p.x + middleX,i,p.z + middleZ)); i--) {
            world.setBlock(p.x + middleX,i,p.z + middleZ,BPBlocks.basalt,0,0);
          }
          for (int i=posHeight + 1; i < vulcanoHeight; i++) {
            if (canReplace(world,p.x + middleX,i,p.z + middleZ))             world.setBlock(p.x + middleX,i,p.z + middleZ,Blocks.air,0,0);
          }
        }
        isFinished=false;
      }
      first=false;
    }
    if (isFinished)     break;
  }
  generateLavaColumn(world,middleX,vulcanoHeight,middleZ,rand);
}

Fixed version (ground truth):
public void generate(World world,Random rand,int middleX,int vulcanoHeight,int middleZ){
  List<Pos>[] distMap=calculateDistMap();
  boolean first=true;
  for (int dist=0; dist < distMap.length; dist++) {
    List<Pos> distList=distMap[dist];
    boolean isFinished=true;
    for (    Pos p : distList) {
      int worldHeight=world.getHeightValue(p.x + middleX,p.z + middleZ) - 1;
      int posHeight=first ? vulcanoHeight : getNewVulcanoHeight(worldHeight,p,rand,dist);
      if (posHeight >= 0 && (posHeight > worldHeight || canReplace(world,p.x + middleX,posHeight,p.z + middleZ))) {
        vulcanoMap.put(p,posHeight);
        if (!first) {
          for (int i=posHeight; i > 0 && (i > worldHeight || canReplace(world,p.x + middleX,i,p.z + middleZ)); i--) {
            world.setBlock(p.x + middleX,i,p.z + middleZ,BPBlocks.basalt,0,0);
          }
          for (int i=posHeight + 1; i < vulcanoHeight; i++) {
            if (canReplace(world,p.x + middleX,i,p.z + middleZ) && world.getBlock(p.x + middleX,i,p.z + middleZ).getMaterial() != Material.water)             world.setBlock(p.x + middleX,i,p.z + middleZ,Blocks.air,0,0);
          }
        }
        isFinished=false;
      }
      first=false;
    }
    if (isFinished)     break;
  }
  generateLavaColumn(world,middleX,vulcanoHeight,middleZ,rand);
}
Program: 169545
Project: 169545
Buggy source:
@Override public int getLightValue(IBlockAccess world,int x,int y,int z){
}

Fixed version (ground truth):
@Override public int getLightValue(IBlockAccess world,int x,int y,int z){
  int metadata=world.getBlockMetadata(x,y,z);
  if ((metadata & 8) != 0) {
    return 13;
  }
  return 0;
}
Program: 169546
Project: 169546
Buggy source:
@Override @SideOnly(Side.CLIENT) public IIcon getIcon(int side,int meta){
}

Fixed version (ground truth):
@Override @SideOnly(Side.CLIENT) public IIcon getIcon(int side,int meta){
  ForgeDirection s=ForgeDirection.getOrientation(side);
  if ((meta & 7) == side) {
    if ((meta & 8) != 0) {
      return this.textureFrontOn;
    }
 else {
      return this.textureFrontOff;
    }
  }
switch (s) {
case UP:
    return textureTop;
case DOWN:
  return textureBottom;
case EAST:
case NORTH:
case SOUTH:
case WEST:
case UNKNOWN:
return textureSide;
default :
break;
}
return null;
}
Program: 169547
Project: 169547
Buggy source:
/** 
 * Function gets called every tick. Do not forget to call the super method!
 */
@Override public void updateEntity(){
}

Fixed version (ground truth):
/** 
 * Function gets called every tick. Do not forget to call the super method!
 */
@Override public void updateEntity(){
  super.updateEntity();
  if (!metaSet) {
    metaSet=true;
    int newMeta=getBlockMetadata();
    newMeta=newMeta & 7;
    newMeta|=(isActive == true ? 8 : 0);
    getWorldObj().setBlockMetadataWithNotify(xCoord,yCoord,zCoord,newMeta,2);
  }
}
Program: 169548
Project: 169548
Buggy source:
public BlockCrop(){
  this.setTickRandomly(true);
  float f=0.5F;
  this.setBlockBounds(0.5F - f,0.0F,0.5F - f,0.5F + f,0.25F,0.5F + f);
  this.setCreativeTab((CreativeTabs)null);
  this.setHardness(0.0F);
  this.setStepSound(soundTypeGrass);
  this.disableStats();
  this.setBlockName(Refs.FLAXCROP_NAME);
}

Fixed version (ground truth):
public BlockCrop(){
  this.setTickRandomly(true);
  float f=0.5F;
  this.setBlockBounds(0.5F - f,0.0F,0.5F - f,0.5F + f,0.25F,0.5F + f);
  this.setCreativeTab((CreativeTabs)null);
  this.setHardness(0.0F);
  this.setStepSound(soundTypeGrass);
  this.disableStats();
  this.setBlockName(Refs.FLAXCROP_NAME);
  this.setBlockTextureName(Refs.MODID + "String_Node_Str" + Refs.FLAXCROP_NAME);
}
Program: 169549
Project: 169549
Buggy source:
/** 
 * Ticks the block if it's been scheduled
 */
public void updateTick(World world,int x,int y,int z,Random random){
  super.updateTick(world,x,y,z,random);
  if (world.getBlockLightValue(x,y + 1,z) >= 9) {
    int l=world.getBlockMetadata(x,y,z);
    if (l < 7) {
      float f=this.func_149864_n(world,x,y,z);
      if (random.nextInt((int)(25.0F / f) + 1) == 0) {
        ++l;
        world.setBlockMetadataWithNotify(x,y,z,l,2);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Ticks the block if it's been scheduled
 */
public void updateTick(World world,int x,int y,int z,Random random){
  super.updateTick(world,x,y,z,random);
  if (world.getBlockLightValue(x,y + 1,z) >= 9) {
    int meta=world.getBlockMetadata(x,y,z);
    if ((meta == 4) || (meta == 5)) {
      return;
    }
    if ((world.getBlock(x,y - 1,z) != Blocks.farmland) || (world.getBlock(x,y - 1,z) == Blocks.air) || (!world.isAirBlock(x,y + 1,z))) {
      return;
    }
    if (random.nextInt(30) == 0) {
      world.setBlockMetadataWithNotify(x,y,z,meta + 1,2);
      if (meta == 3)       world.setBlock(x,y + 1,z,BPBlocks.flax_crop,5,2);
    }
  }
}
Program: 169551
Project: 169551
Buggy source:
public boolean onItemUse(ItemStack itemStack,EntityPlayer player,World world,int x,int y,int z,int side,float hitX,float hitY,float hitZ){
  if (side != 1) {
    return false;
  }
 else   if (player.canPlayerEdit(x,y,z,side,itemStack) && player.canPlayerEdit(x,y + 1,z,side,itemStack)) {
    if (world.getBlock(x,y,z).canSustainPlant(world,x,y,z,ForgeDirection.UP,this) && world.isAirBlock(x,y + 1,z)) {
      world.setBlock(x,y + 1,z,this.field_150925_a);
      --itemStack.stackSize;
      return true;
    }
 else {
      return false;
    }
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
public boolean onItemUse(ItemStack itemStack,EntityPlayer player,World world,int x,int y,int z,int side,float hitX,float hitY,float hitZ){
  if (side != 1) {
    return false;
  }
 else   if (player.canPlayerEdit(x,y,z,side,itemStack) && player.canPlayerEdit(x,y + 1,z,side,itemStack)) {
    if (world.getBlock(x,y,z).canSustainPlant(world,x,y,z,ForgeDirection.UP,this) && world.isAirBlock(x,y + 1,z)) {
      world.setBlock(x,y + 1,z,this.field_150925_a,0,2);
      --itemStack.stackSize;
      return true;
    }
 else {
      return false;
    }
  }
 else {
    return false;
  }
}
Program: 169552
Project: 169552
Buggy source:
@EventHandler public void PreInit(FMLPreInitializationEvent event){
  event.getModMetadata().version=Refs.fullVersionString();
  Logger log=event.getModLog();
  Configuration config=new Configuration(event.getSuggestedConfigurationFile());
  config.load();
  Config.setUp(config);
  config.save();
  Blocks.init();
  Items.init();
}

Fixed version (ground truth):
@EventHandler public void PreInit(FMLPreInitializationEvent event){
  event.getModMetadata().version=Refs.fullVersionString();
  Logger log=event.getModLog();
  Configuration config=new Configuration(event.getSuggestedConfigurationFile());
  CustomTabs.init();
  config.load();
  Config.setUp(config);
  config.save();
  Blocks.init();
  Items.init();
}
Program: 169553
Project: 169553
Buggy source:
public BlockGemOre(String type){
  super(Material.iron);
  this.setCreativeTab(BluePower.creativeTab);
  this.setStepSound(soundTypeStone);
  this.setHardness(2.5F);
  this.setResistance(10.0F);
  this.textureName=Refs.MODID + "String_Node_Str" + type;
  this.setBlockName(type);
}

Fixed version (ground truth):
public BlockGemOre(String type){
  super(Material.iron);
  this.setCreativeTab(CustomTabs.tabBluePowerBlocks);
  this.setStepSound(soundTypeStone);
  this.setHardness(2.5F);
  this.setResistance(10.0F);
  this.textureName=Refs.MODID + "String_Node_Str" + type;
  this.setBlockName(type);
}
Program: 169554
Project: 169554
Buggy source:
public BlockNikoliteBlock(String name){
  super(Material.rock);
  this.textureName=Refs.MODID + "String_Node_Str" + name;
  this.setCreativeTab(CreativeTabs.tabBlock);
  this.setStepSound(soundTypeStone);
  this.setHardness(1.9F);
  this.setResistance(10.0F);
  this.setBlockName(name);
}

Fixed version (ground truth):
public BlockNikoliteBlock(String name){
  super(Material.rock);
  this.textureName=Refs.MODID + "String_Node_Str" + name;
  this.setCreativeTab(CustomTabs.tabBluePowerBlocks);
  this.setStepSound(soundTypeStone);
  this.setHardness(1.9F);
  this.setResistance(10.0F);
  this.setBlockName(name);
}
Program: 169555
Project: 169555
Buggy source:
public BlockNikoliteOre(String name){
  super(Material.rock);
  this.textureName=Refs.MODID + "String_Node_Str" + name;
  this.setCreativeTab(BluePower.creativeTab);
  this.setStepSound(soundTypeStone);
  this.setHardness(1.9F);
  this.setResistance(10.0F);
  this.setBlockName(name);
}

Fixed version (ground truth):
public BlockNikoliteOre(String name){
  super(Material.rock);
  this.textureName=Refs.MODID + "String_Node_Str" + name;
  this.setCreativeTab(CustomTabs.tabBluePowerBlocks);
  this.setStepSound(soundTypeStone);
  this.setHardness(1.9F);
  this.setResistance(10.0F);
  this.setBlockName(name);
}
Program: 169556
Project: 169556
Buggy source:
public BlockStoneOre(String name){
  super(Material.rock);
  this.setBlockName(name);
  this.setHardness(1.9F);
  if (name == Refs.BASALT_NAME) {
    this.setResistance(25.0F);
  }
 else {
    this.setResistance(10.0F);
  }
  this.textureName=Refs.MODID + "String_Node_Str" + name;
  this.setCreativeTab(BluePower.creativeTab);
  this.setStepSound(soundTypeStone);
}

Fixed version (ground truth):
public BlockStoneOre(String name){
  super(Material.rock);
  this.setBlockName(name);
  this.setHardness(1.9F);
  if (name == Refs.BASALT_NAME) {
    this.setResistance(25.0F);
  }
 else {
    this.setResistance(10.0F);
  }
  this.textureName=Refs.MODID + "String_Node_Str" + name;
  this.setCreativeTab(CustomTabs.tabBluePowerBlocks);
  this.setStepSound(soundTypeStone);
}
Program: 169557
Project: 169557
Buggy source:
public ContainerAlloyFurnace(){
  super(Material.rock);
  this.setHardness(1.5F);
  this.setResistance(20.0F);
  this.setCreativeTab(BluePower.creativeTab);
}

Fixed version (ground truth):
public ContainerAlloyFurnace(){
  super(Material.rock);
  this.setHardness(1.5F);
  this.setResistance(20.0F);
  this.setCreativeTab(CustomTabs.tabBluePowerMachines);
}
Program: 169558
Project: 169558
Buggy source:
public ItemMalachite(){
  super();
  this.setUnlocalizedName(Refs.ITEMMALACHITE_NAME);
  this.setCreativeTab(BluePower.creativeTab);
}

Fixed version (ground truth):
public ItemMalachite(){
  super();
  this.setUnlocalizedName(Refs.ITEMMALACHITE_NAME);
  this.setCreativeTab(CustomTabs.tabBluePowerBlocks);
}
Program: 169559
Project: 169559
Buggy source:
public ItemNikolite(){
  super();
  this.setUnlocalizedName(Refs.ITEMNIKOLITE_NAME);
  this.setCreativeTab(BluePower.creativeTab);
}

Fixed version (ground truth):
public ItemNikolite(){
  super();
  this.setUnlocalizedName(Refs.ITEMNIKOLITE_NAME);
  this.setCreativeTab(CustomTabs.tabBluePowerBlocks);
}
Program: 169560
Project: 169560
Buggy source:
public ItemRuby(){
  super();
  this.setUnlocalizedName(Refs.ITEMRUBY_NAME);
  this.setCreativeTab(BluePower.creativeTab);
}

Fixed version (ground truth):
public ItemRuby(){
  super();
  this.setUnlocalizedName(Refs.ITEMRUBY_NAME);
  this.setCreativeTab(CustomTabs.tabBluePowerBlocks);
}
Program: 169561
Project: 169561
Buggy source:
public ItemSapphire(){
  super();
  this.setUnlocalizedName(Refs.ITEMSAPPHIRE_NAME);
  this.setCreativeTab(BluePower.creativeTab);
}

Fixed version (ground truth):
public ItemSapphire(){
  super();
  this.setUnlocalizedName(Refs.ITEMSAPPHIRE_NAME);
  this.setCreativeTab(CustomTabs.tabBluePowerBlocks);
}
Program: 169562
Project: 169562
Buggy source:
public Boolean getImmutable(){
  return immutable;
}

Fixed version (ground truth):
public boolean getImmutable(){
  return immutable;
}
Program: 169563
Project: 169563
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public int hashCode(){
  int result=super.hashCode();
  result=31 * result + uuidGenerator.hashCode();
  result=31 * result + uuidProperty.hashCode();
  result=31 * result + uuidIndex.hashCode();
  result=31 * result + uuidRelationshipIndex.hashCode();
  result=31 * result + stripHyphens.hashCode();
  result=31 * result + immutable.hashCode();
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  int result=super.hashCode();
  result=31 * result + uuidGenerator.hashCode();
  result=31 * result + uuidProperty.hashCode();
  result=31 * result + uuidIndex.hashCode();
  result=31 * result + uuidRelationshipIndex.hashCode();
  result=31 * result + (stripHyphens ? 1 : 0);
  result=31 * result + (immutable ? 1 : 0);
  return result;
}
Program: 169564
Project: 169564
Buggy source:
/** 
 * Create a new instance of this   {@link UuidConfiguration} with a custom immutability setting.
 * @param immutability property of new instance.
 * @return new instance.
 */
public UuidConfiguration withImmutability(boolean immutability){
  return new UuidConfiguration(getInclusionPolicies(),initializeUntil(),getUuidGenerator(),getUuidProperty(),stripHyphens,getUuidIndex(),getUuidRelationshipIndex(),immutability);
}

Fixed version (ground truth):
/** 
 * Create a new instance of this   {@link UuidConfiguration} with a custom immutability setting.
 * @param immutability property of new instance.
 * @return new instance.
 */
public UuidConfiguration withImmutability(boolean immutability){
  return new UuidConfiguration(getInclusionPolicies(),initializeUntil(),getUuidGenerator(),getUuidProperty(),shouldStripHyphens(),getUuidIndex(),getUuidRelationshipIndex(),immutability);
}
Program: 169566
Project: 169566
Buggy source:
@Test public void testUuidCanBeChangedWhenImmutableIsFalse() throws InterruptedException {
  database=new TestGraphDatabaseFactory().newImpermanentDatabaseBuilder().loadPropertiesFromFile(this.getClass().getClassLoader().getResource("String_Node_Str").getPath()).newGraphDatabase();
  getRuntime(database).waitUntilStarted();
  UuidApi api=new UuidApi(database);
  try (Transaction tx=database.beginTx()){
    Node node=database.createNode();
    node.addLabel(personLabel);
    node.setProperty("String_Node_Str","String_Node_Str");
    tx.success();
  }
   try (Transaction tx=database.beginTx()){
    for (    Node node : asIterable(database.findNodes(personLabel))) {
      assertTrue(node.hasProperty(UUID));
      assertFalse(node.getProperty(UUID).toString().contains("String_Node_Str"));
      assertEquals(Long.valueOf(node.getId()),api.getNodeIdByUuid((String)node.getProperty(UUID)));
    }
    tx.success();
  }
   try (Transaction tx=database.beginTx()){
    for (    Node node : asIterable(database.findNodes(personLabel))) {
      node.setProperty(UUID,"String_Node_Str" + String.valueOf(node.getId()));
    }
    tx.success();
  }
   try (Transaction tx=database.beginTx()){
    for (    Node node : asIterable(database.findNodes(personLabel))) {
      assertEquals("String_Node_Str" + String.valueOf(node.getId()),node.getProperty(UUID).toString());
    }
    tx.success();
  }
 }

Fixed version (ground truth):
@Test public void testUuidCanBeChangedWhenImmutableIsFalse() throws InterruptedException {
  database=new TestGraphDatabaseFactory().newImpermanentDatabaseBuilder().loadPropertiesFromFile(this.getClass().getClassLoader().getResource("String_Node_Str").getPath()).newGraphDatabase();
  getRuntime(database).waitUntilStarted();
  UuidApi api=new UuidApi(database);
  try (Transaction tx=database.beginTx()){
    Node node=database.createNode();
    node.addLabel(personLabel);
    node.setProperty("String_Node_Str","String_Node_Str");
    tx.success();
  }
   Long nodeId=null;
  String oldUuid=null;
  String newUuid=null;
  try (Transaction tx=database.beginTx()){
    for (    Node node : asIterable(database.findNodes(personLabel))) {
      assertTrue(node.hasProperty(UUID));
      nodeId=node.getId();
      oldUuid=(String)node.getProperty(UUID);
      assertEquals(nodeId,api.getNodeIdByUuid(oldUuid));
    }
    tx.success();
  }
   try (Transaction tx=database.beginTx()){
    for (    Node node : asIterable(database.findNodes(personLabel))) {
      newUuid="String_Node_Str" + nodeId;
      node.setProperty(UUID,newUuid);
    }
    tx.success();
  }
   try (Transaction tx=database.beginTx()){
    for (    Node node : asIterable(database.findNodes(personLabel))) {
      assertEquals(newUuid,node.getProperty(UUID).toString());
    }
    tx.success();
  }
   try (Transaction tx=database.beginTx()){
    assertEquals(nodeId,api.getNodeIdByUuid(newUuid));
    tx.success();
  }
   try (Transaction tx=database.beginTx()){
    try {
      api.getNodeIdByUuid(oldUuid);
      fail();
    }
 catch (    NotFoundException e) {
    }
  }
 }
Program: 169567
Project: 169567
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void initialize(GraphDatabaseService database){
  new IterableInputBatchTransactionExecutor<>(database,BATCH_SIZE,new AllNodes(database,BATCH_SIZE),(db,node,batchNumber,stepNumber) -> {
    if (getConfiguration().getInclusionPolicies().getNodeInclusionPolicy().include(node)) {
      assignUuid(node);
    }
  }
).execute();
  new IterableInputBatchTransactionExecutor<>(database,BATCH_SIZE,new AllRelationships(database,BATCH_SIZE),(db,rel,batchNumber,stepNumber) -> {
    if (getConfiguration().getInclusionPolicies().getRelationshipInclusionPolicy().include(rel)) {
      assignUuid(rel);
    }
  }
).execute();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void initialize(GraphDatabaseService database){
  if (new InstanceRoleUtils(database).getInstaceRole().isWritable()) {
    new IterableInputBatchTransactionExecutor<>(database,BATCH_SIZE,new AllNodes(database,BATCH_SIZE),(db,node,batchNumber,stepNumber) -> {
      if (getConfiguration().getInclusionPolicies().getNodeInclusionPolicy().include(node)) {
        assignUuid(node);
      }
    }
).execute();
    new IterableInputBatchTransactionExecutor<>(database,BATCH_SIZE,new AllRelationships(database,BATCH_SIZE),(db,rel,batchNumber,stepNumber) -> {
      if (getConfiguration().getInclusionPolicies().getRelationshipInclusionPolicy().include(rel)) {
        assignUuid(rel);
      }
    }
).execute();
  }
}
Program: 169568
Project: 169568
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void initialize(GraphDatabaseService database){
  new IterableInputBatchTransactionExecutor<>(database,BATCH_SIZE,new TransactionCallback<Iterable<Node>>(){
    @Override public Iterable<Node> doInTransaction(    GraphDatabaseService database) throws Exception {
      return GlobalGraphOperations.at(database).getAllNodes();
    }
  }
,new UnitOfWork<Node>(){
    @Override public void execute(    GraphDatabaseService database,    Node node,    int batchNumber,    int stepNumber){
      assignUuid(node);
    }
  }
).execute();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void initialize(GraphDatabaseService database){
  new IterableInputBatchTransactionExecutor<>(database,BATCH_SIZE,new TransactionCallback<Iterable<Node>>(){
    @Override public Iterable<Node> doInTransaction(    GraphDatabaseService database) throws Exception {
      return GlobalGraphOperations.at(database).getAllNodes();
    }
  }
,new UnitOfWork<Node>(){
    @Override public void execute(    GraphDatabaseService database,    Node node,    int batchNumber,    int stepNumber){
      if (getConfiguration().getInclusionStrategies().getNodeInclusionStrategy().include(node) && nodeToBeConsideredByModule(node)) {
        assignUuid(node);
      }
    }
  }
).execute();
}
Program: 169569
Project: 169569
Buggy source:
@Override public void execute(GraphDatabaseService database,Node node,int batchNumber,int stepNumber){
  assignUuid(node);
}

Fixed version (ground truth):
@Override public void execute(GraphDatabaseService database,Node node,int batchNumber,int stepNumber){
  if (getConfiguration().getInclusionStrategies().getNodeInclusionStrategy().include(node) && nodeToBeConsideredByModule(node)) {
    assignUuid(node);
  }
}
Program: 169570
Project: 169570
Buggy source:
public static void setHasFileDownloaded(Context context){
  File file=RomUpdate.getFullFile(context);
  int filesize=RomUpdate.getFileSize(context);
  boolean status=false;
  if (DEBUGGING)   Log.d(TAG,"String_Node_Str" + file.getAbsolutePath());
  Log.d(TAG,"String_Node_Str" + file.length());
  Log.d(TAG,"String_Node_Str" + filesize);
  if (file.length() != 0 && file.length() == filesize) {
    status=true;
  }
  Preferences.setDownloadFinished(context,status);
}

Fixed version (ground truth):
public static void setHasFileDownloaded(Context context){
  File file=RomUpdate.getFullFile(context);
  int filesize=RomUpdate.getFileSize(context);
  boolean status=false;
  if (DEBUGGING) {
    Log.d(TAG,"String_Node_Str" + file.getAbsolutePath());
    Log.d(TAG,"String_Node_Str" + file.length());
    Log.d(TAG,"String_Node_Str" + filesize);
  }
  if (file.length() != 0 && file.length() == filesize) {
    status=true;
  }
  Preferences.setDownloadFinished(context,status);
}
Program: 169571
Project: 169571
Buggy source:
@Override public IModule build(ItemStack stack){
  if (stack != null && stack.getItem() instanceof IModuleItem) {
  }
  return super.build(stack);
}

Fixed version (ground truth):
@Override public IModule build(ItemStack stack){
  if (stack != null && stack.getItem() instanceof IModuleItem) {
    IModule module=((IModuleItem)stack.getItem()).getModule(stack);
    if (module != null) {
      return module;
    }
  }
  return super.build(stack);
}
Program: 169572
Project: 169572
Buggy source:
@Override public NBTTagCompound save(NBTTagCompound nbt){
  if (explosive != null) {
    nbt.setTag("String_Node_Str",explosive.writeToNBT(new NBTTagCompound()));
  }
  return nbt;
}

Fixed version (ground truth):
@Override public NBTTagCompound save(NBTTagCompound nbt){
  if (explosive != null) {
    nbt.setTag(NBT_EXPLOSIVE_ITEMSTACK,explosive.writeToNBT(new NBTTagCompound()));
  }
  return nbt;
}
Program: 169573
Project: 169573
Buggy source:
/** 
 * Loads the explosive item from the item save for the warhead.
 * @param nbt - warhead save data
 * @return new ItemStack as long as the nbt has the tag exItem
 */
public static ItemStack loadExplosiveItemFromNBT(NBTTagCompound nbt){
  if (nbt != null && nbt.hasKey("String_Node_Str")) {
    ItemStack explosive=ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("String_Node_Str"));
    if (explosive == null) {
      Engine.error("String_Node_Str");
    }
    return explosive;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Loads the explosive item from the item save for the warhead.
 * @param nbt - warhead save data
 * @return new ItemStack as long as the nbt has the tag exItem
 */
public static ItemStack loadExplosiveItemFromNBT(NBTTagCompound nbt){
  if (nbt != null && nbt.hasKey(NBT_EXPLOSIVE_ITEMSTACK)) {
    NBTTagCompound explosiveItemSave=nbt.getCompoundTag(NBT_EXPLOSIVE_ITEMSTACK);
    ItemStack explosiveItemStack=ItemStack.loadItemStackFromNBT(explosiveItemSave);
    if (explosiveItemStack == null) {
      Engine.error("String_Node_Str");
    }
    return explosiveItemStack;
  }
  return null;
}
Program: 169574
Project: 169574
Buggy source:
@Override public IWarhead getModule(ItemStack stack){
  return WarheadCasings.get(stack).buildModule(stack);
}

Fixed version (ground truth):
@Override public IWarhead getModule(ItemStack stack){
  IWarhead warhead=WarheadCasings.get(stack).buildModule(stack);
  if (warhead != null && stack.getTagCompound() != null) {
    warhead.load(stack.getTagCompound());
  }
  return warhead;
}
Program: 169575
Project: 169575
Buggy source:
/** 
 * Reads a tile entity from NBT.
 */
@Override public void readFromNBT(NBTTagCompound nbt){
  super.readFromNBT(nbt);
  setWarhead(null);
  if (nbt.hasKey("String_Node_Str")) {
    setWarhead(MissileModuleBuilder.INSTANCE.buildWarhead(ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("String_Node_Str"))));
  }
}

Fixed version (ground truth):
/** 
 * Reads a tile entity from NBT.
 */
@Override public void readFromNBT(NBTTagCompound nbt){
  super.readFromNBT(nbt);
  setWarhead(null);
  if (nbt.hasKey("String_Node_Str")) {
    NBTTagCompound warheadSave=nbt.getCompoundTag("String_Node_Str");
    ItemStack warheadStack=ItemStack.loadItemStackFromNBT(warheadSave);
    setWarhead(MissileModuleBuilder.INSTANCE.buildWarhead(warheadStack));
  }
}