nus-yam/ex-repair huggingface dataset:
Program: 80766
Project: 80766
Buggy source:
@Override public boolean isItemValidForSlot(int slot,ItemStack stack){
  if (stack == null)   return false;
  if ((slot == this.SLOT_SHEARS) && (stack.getItem() == Items.shears) && (hasUpgrade(UpgradeType.SHEARING))) {
    return true;
  }
 else   if ((slot == this.SLOT_BUCKETS) && (stack.getItem() == Items.bucket) && (hasUpgrade(UpgradeType.MILKER))) {
    return true;
  }
  return super.isItemValidForSlot(slot,stack);
}

Fixed version (ground truth):
@Override public boolean isItemValidForSlot(int slot,ItemStack stack){
  if (stack == null)   return false;
  if ((slot == this.SLOT_FOOD) && (this.isFeed(stack))) {
    return true;
  }
  if ((slot == this.SLOT_SHEARS) && (stack.getItem() == Items.shears) && (hasUpgrade(UpgradeType.SHEARING))) {
    return true;
  }
 else   if ((slot == this.SLOT_BUCKETS) && (stack.getItem() == Items.bucket) && (hasUpgrade(UpgradeType.MILKER))) {
    return true;
  }
  return super.isItemValidForSlot(slot,stack);
}
Program: 80767
Project: 80767
Buggy source:
public boolean isItemValid(ItemStack itemStack){
  if (itemStack.getItem() == Items.wheat)   return true;
  if (itemStack.getItem() == Items.wheat_seeds)   return true;
  if (itemStack.getItem() == Items.carrot)   return true;
  return false;
}

Fixed version (ground truth):
public boolean isItemValid(ItemStack itemStack){
  return TileFarmer.isFeed(itemStack);
}
Program: 80768
Project: 80768
Buggy source:
public static boolean damageTool(ItemStack tool,World world,int x,int y,int z){
  if ((tool.getItem() instanceof ItemShears) || (tool.getItem() instanceof ItemTool) || (tool.getItem() instanceof ItemHoe)|| (tool.getItem() instanceof ItemSword)) {
    if (tool.attemptDamageItem(1,RND)) {
      return true;
    }
  }
 else {
    Block mineBlock=world.getBlock(x,y,z);
    PlayerFake fakePlayer=new PlayerFake((WorldServer)world);
    tool.getItem().onBlockDestroyed(tool,world,mineBlock,x,y,z,fakePlayer);
  }
  return false;
}

Fixed version (ground truth):
public static boolean damageTool(ItemStack tool,World world,int x,int y,int z){
  if ((tool.getItem() instanceof ItemShears) || (tool.getItem() instanceof ItemTool) || (tool.getItem() instanceof ItemHoe)|| (tool.getItem() instanceof ItemSword)) {
    if (tool.attemptDamageItem(1,RND)) {
      return true;
    }
  }
 else {
    Block mineBlock=world.getBlock(x,y,z);
    PlayerFake fakePlayer=new PlayerFake((WorldServer)world);
    if (tinkersType(tool.getItem()) == TYPE_HOE) {
      tool.attemptDamageItem(1,RND);
    }
 else {
      tool.getItem().onBlockDestroyed(tool,world,mineBlock,x,y,z,fakePlayer);
    }
  }
  return false;
}
Program: 80770
Project: 80770
Buggy source:
protected boolean checkIngredients(boolean consume){
  List<ItemStack> required=new ArrayList<ItemStack>();
  for (int i=CRAFT_GRID_START; i <= CRAFT_GRID_END; i++) {
    if (this.slots[i] != null) {
      required.add(slots[i].copy());
    }
  }
  if (required.size() == 0)   return false;
  for (int i=SLOT_INVENTORY_START; i <= SLOT_INVENTORY_END; i++) {
    if (slots[i] != null) {
      int amtItems=slots[i].stackSize;
      for (int j=0; j < required.size(); j++) {
        if (required.get(j) != null) {
          if (OreHelper.ItemOreMatch(required.get(j),slots[i])) {
            if (amtItems > 0) {
              amtItems--;
              required.set(j,null);
            }
          }
        }
      }
      if (consume) {
        if (amtItems <= 0) {
          slots[i]=null;
        }
 else {
          slots[i].stackSize=amtItems;
        }
      }
    }
  }
  for (int j=0; j < required.size(); j++) {
    if (required.get(j) != null) {
      required=null;
      return false;
    }
  }
  required=null;
  return true;
}

Fixed version (ground truth):
protected boolean checkIngredients(boolean consume){
  List<ItemStack> required=new ArrayList<ItemStack>();
  for (int i=CRAFT_GRID_START; i <= CRAFT_GRID_END; i++) {
    if (this.slots[i] != null) {
      required.add(slots[i].copy());
    }
  }
  if (required.size() == 0)   return false;
  for (int i=SLOT_INVENTORY_START; i <= SLOT_INVENTORY_END; i++) {
    if (slots[i] != null) {
      int amtItems=slots[i].stackSize;
      for (int j=0; j < required.size(); j++) {
        if (required.get(j) != null) {
          if (OreHelper.ItemOreMatch(required.get(j),slots[i])) {
            if (amtItems > 0) {
              amtItems--;
              required.set(j,null);
            }
          }
        }
      }
      if (consume) {
        if (amtItems <= 0) {
          if (slots[i].getItem().hasContainerItem(slots[i])) {
            this.addToInventory(new ItemStack(slots[i].getItem().getContainerItem(),slots[i].stackSize));
          }
          slots[i]=null;
        }
 else {
          if (slots[i].getItem().hasContainerItem(slots[i])) {
            this.addToInventory(new ItemStack(slots[i].getItem().getContainerItem(),slots[i].stackSize - amtItems));
          }
          slots[i].stackSize=amtItems;
        }
      }
    }
  }
  for (int j=0; j < required.size(); j++) {
    if (required.get(j) != null) {
      required=null;
      return false;
    }
  }
  required=null;
  return true;
}
Program: 80771
Project: 80771
Buggy source:
public ArrayList<ItemStack> harvestPlant(Point3I plantPoint,Block plantBlock,int metadata,World worldObj){
  ArrayList<ItemStack> items=plantBlock.getDrops(worldObj,plantPoint.getX(),plantPoint.getY(),plantPoint.getZ(),metadata,0);
  worldObj.removeTileEntity(plantPoint.getX(),plantPoint.getY(),plantPoint.getZ());
  worldObj.setBlockToAir(plantPoint.getX(),plantPoint.getY(),plantPoint.getZ());
  return items;
}

Fixed version (ground truth):
public List<ItemStack> harvestPlant(Point3I plantPoint,Block plantBlock,IBlockState state,World worldObj){
  List<ItemStack> items=plantBlock.getDrops(worldObj,plantPoint.toPosition(),state,0);
  worldObj.removeTileEntity(plantPoint.toPosition());
  worldObj.setBlockToAir(plantPoint.toPosition());
  return items;
}
Program: 80772
Project: 80772
Buggy source:
public boolean isPlant(Block plantBlock,int metadata){
  return false;
}

Fixed version (ground truth):
public boolean isPlant(Block plantBlock,IBlockState state){
  return false;
}
Program: 80773
Project: 80773
Buggy source:
public boolean isGrown(Point3I plantPoint,Block plantBlock,int metadata,World worldObj){
  return false;
}

Fixed version (ground truth):
public boolean isGrown(Point3I plantPoint,Block plantBlock,IBlockState state,World worldObj){
  return false;
}
Program: 80774
Project: 80774
Buggy source:
public static ArrayList<ItemStack> harvestPlant(Point3I plantPoint,Block plantBlock,int metadata,World worldObj){
  ArrayList<ItemStack> items=null;
  for (  BaseMod mod : modsLoaded) {
    if (mod.isPlant(plantBlock,metadata)) {
      if (mod.isGrown(plantPoint,plantBlock,metadata,worldObj)) {
        items=mod.harvestPlant(plantPoint,plantBlock,metadata,worldObj);
        if (items != null)         return items;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public static List<ItemStack> harvestPlant(Point3I plantPoint,Block plantBlock,IBlockState state,World worldObj){
  List<ItemStack> items=null;
  for (  BaseMod mod : modsLoaded) {
    if (mod.isPlant(plantBlock,state)) {
      if (mod.isGrown(plantPoint,plantBlock,state,worldObj)) {
        items=mod.harvestPlant(plantPoint,plantBlock,state,worldObj);
        if (items != null)         return items;
      }
    }
  }
  return null;
}
Program: 80775
Project: 80775
Buggy source:
public static boolean isPlant(Block plantBlock,int metadata){
  for (  BaseMod mod : modsLoaded) {
    if (mod.isPlant(plantBlock,metadata))     return true;
  }
  return false;
}

Fixed version (ground truth):
public static boolean isPlant(Block plantBlock,IBlockState state){
  for (  BaseMod mod : modsLoaded) {
    if (mod.isPlant(plantBlock,state))     return true;
  }
  return false;
}
Program: 80776
Project: 80776
Buggy source:
private static void registerMods(){
  registerMod(new Pams());
  registerMod(new Pneumaticcraft());
  registerMod(new MFR());
  registerMod(new AgriCraft());
  registerMod(new RightClick());
  registerMod(new Vanilla());
}

Fixed version (ground truth):
private static void registerMods(){
  registerMod(new MFR());
  registerMod(new RightClick());
  registerMod(new Vanilla());
}
Program: 80777
Project: 80777
Buggy source:
public static boolean isGrown(Point3I plantPoint,Block plantBlock,int metadata,World worldObj){
  for (  BaseMod mod : modsLoaded) {
    if (mod.isPlant(plantBlock,metadata)) {
      if (mod.isGrown(plantPoint,plantBlock,metadata,worldObj))       return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean isGrown(Point3I plantPoint,Block plantBlock,IBlockState state,World worldObj){
  for (  BaseMod mod : modsLoaded) {
    if (mod.isPlant(plantBlock,state)) {
      if (mod.isGrown(plantPoint,plantBlock,state,worldObj))       return true;
    }
  }
  return false;
}
Program: 80778
Project: 80778
Buggy source:
@Override public ArrayList<ItemStack> harvestPlant(Point3I point,Block plantBlock,int metadata,World worldObj){
  PlayerFake faker=new PlayerFake((WorldServer)worldObj);
  plantBlock.onBlockActivated(worldObj,point.getX(),point.getY(),point.getZ(),faker,metadata,0,0,0);
  ArrayList<ItemStack> items=new ArrayList<ItemStack>();
  IInventory inv=faker.inventory;
  for (int i=0; i < inv.getSizeInventory(); i++) {
    if (inv.getStackInSlot(i) != null) {
      items.add(inv.getStackInSlot(i).copy());
    }
  }
  AxisAlignedBB block=AxisAlignedBB.getBoundingBox(point.getX(),point.getY(),point.getZ(),point.getX() + 1,point.getY() + 1,point.getZ() + 1);
  List<EntityItem> entities=worldObj.getEntitiesWithinAABB(EntityItem.class,block);
  if (entities.isEmpty()) {
    return null;
  }
  for (  EntityItem item : entities) {
    items.add(item.getEntityItem());
    worldObj.removeEntity(item);
  }
  return items;
}

Fixed version (ground truth):
@Override public List<ItemStack> harvestPlant(Point3I point,Block plantBlock,IBlockState state,World worldObj){
  PlayerFake faker=new PlayerFake((WorldServer)worldObj);
  plantBlock.onBlockActivated(worldObj,point.toPosition(),state,faker,EnumFacing.DOWN,0,0,0);
  ArrayList<ItemStack> items=new ArrayList<ItemStack>();
  IInventory inv=faker.inventory;
  for (int i=0; i < inv.getSizeInventory(); i++) {
    if (inv.getStackInSlot(i) != null) {
      items.add(inv.getStackInSlot(i).copy());
    }
  }
  AxisAlignedBB block=new AxisAlignedBB(point.getX(),point.getY(),point.getZ(),point.getX() + 1,point.getY() + 1,point.getZ() + 1);
  List<EntityItem> entities=worldObj.getEntitiesWithinAABB(EntityItem.class,block);
  if (entities.isEmpty()) {
    return null;
  }
  for (  EntityItem item : entities) {
    items.add(item.getEntityItem());
    worldObj.removeEntity(item);
  }
  return items;
}
Program: 80779
Project: 80779
Buggy source:
@Override public ArrayList<ItemStack> harvestPlant(Point3I plantPoint,Block plantBlock,int metadata,World worldObj){
  if ((plantBlock == Blocks.reeds) || (plantBlock == Blocks.cactus)) {
    plantPoint.setY(plantPoint.getY() + 1);
    plantBlock=worldObj.getBlock(plantPoint.getX(),plantPoint.getY(),plantPoint.getZ());
    metadata=worldObj.getBlockMetadata(plantPoint.getX(),plantPoint.getY(),plantPoint.getZ());
  }
  return super.harvestPlant(plantPoint,plantBlock,metadata,worldObj);
}

Fixed version (ground truth):
@Override public List<ItemStack> harvestPlant(Point3I plantPoint,Block plantBlock,IBlockState state,World worldObj){
  if ((plantBlock == Blocks.reeds) || (plantBlock == Blocks.cactus)) {
    plantPoint.setY(plantPoint.getY() + 1);
    state=worldObj.getBlockState(plantPoint.toPosition());
    plantBlock=state.getBlock();
  }
  return super.harvestPlant(plantPoint,plantBlock,state,worldObj);
}
Program: 80780
Project: 80780
Buggy source:
@Override public boolean isPlant(Block plantBlock,int metadata){
  if (plantBlock instanceof IGrowable)   return true;
  if (plantBlock instanceof BlockNetherWart)   return true;
  if (plantBlock == Blocks.reeds)   return true;
  if (plantBlock == Blocks.cactus)   return true;
  return false;
}

Fixed version (ground truth):
@Override public boolean isPlant(Block plantBlock,IBlockState state){
  if (plantBlock instanceof IGrowable)   return true;
  if (plantBlock instanceof BlockNetherWart)   return true;
  if (plantBlock == Blocks.reeds)   return true;
  if (plantBlock == Blocks.cactus)   return true;
  return false;
}
Program: 80781
Project: 80781
Buggy source:
@Override public boolean isGrown(Point3I plantPoint,Block plantBlock,int metadata,World worldObj){
  if (plantBlock instanceof IGrowable) {
    return !((IGrowable)plantBlock).func_149851_a(worldObj,plantPoint.getX(),plantPoint.getY(),plantPoint.getZ(),true);
  }
 else   if (plantBlock instanceof BlockNetherWart) {
    return (metadata >= 3);
  }
 else   if (plantBlock == Blocks.reeds) {
    return (worldObj.getBlock(plantPoint.getX(),plantPoint.getY() + 1,plantPoint.getZ()) == Blocks.reeds);
  }
 else   if (plantBlock == Blocks.cactus) {
    return (worldObj.getBlock(plantPoint.getX(),plantPoint.getY() + 1,plantPoint.getZ()) == Blocks.cactus);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isGrown(Point3I plantPoint,Block plantBlock,IBlockState state,World worldObj){
  int metadata=plantBlock.getMetaFromState(state);
  if (plantBlock instanceof IGrowable) {
    return !((IGrowable)plantBlock).isStillGrowing(worldObj,plantPoint.toPosition(),state,true);
  }
 else   if (plantBlock instanceof BlockNetherWart) {
    return (metadata >= 3);
  }
 else   if (plantBlock == Blocks.reeds) {
    return (worldObj.getBlockState(plantPoint.toPosition().offsetUp()).getBlock() == Blocks.reeds);
  }
 else   if (plantBlock == Blocks.cactus) {
    return (worldObj.getBlockState(plantPoint.toPosition().offsetUp()).getBlock() == Blocks.cactus);
  }
  return false;
}
Program: 80782
Project: 80782
Buggy source:
@Override public boolean placeSeed(World worldObj,ItemStack itemStack,Point3I point,boolean doAction){
  Block plant=getPlantBlock(worldObj,itemStack,point);
  if (plant != null) {
    if (doAction) {
      worldObj.setBlock(point.getX(),point.getY(),point.getZ(),plant,itemStack.getItem().getDamage(itemStack),7);
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean placeSeed(World worldObj,ItemStack itemStack,Point3I point,boolean doAction){
  IBlockState plant=getPlantBlock(worldObj,itemStack,point);
  if (plant != null) {
    if (doAction) {
      worldObj.setBlockState(point.toPosition(),plant.getBlock().getStateFromMeta(itemStack.getItem().getDamage(itemStack)),7);
    }
    return true;
  }
  return false;
}
Program: 80783
Project: 80783
Buggy source:
protected Block getPlantBlock(World worldObj,ItemStack itemStack,Point3I point){
  Block plant=null;
  if (itemStack.getItem() instanceof IPlantable) {
    plant=((IPlantable)itemStack.getItem()).getPlant(worldObj,point.getX(),point.getY(),point.getZ());
  }
 else   if (itemStack.getItem() == Items.reeds) {
    plant=Blocks.reeds;
  }
 else   if (Block.getBlockFromItem(itemStack.getItem()) == Blocks.cactus) {
    plant=Blocks.cactus;
  }
  return plant;
}

Fixed version (ground truth):
protected IBlockState getPlantBlock(World worldObj,ItemStack itemStack,Point3I point){
  IBlockState plant=null;
  if (itemStack.getItem() instanceof IPlantable) {
    plant=((IPlantable)itemStack.getItem()).getPlant(worldObj,point.toPosition());
  }
 else   if (itemStack.getItem() == Items.reeds) {
    plant=Blocks.reeds.getDefaultState();
  }
 else   if (Block.getBlockFromItem(itemStack.getItem()) == Blocks.cactus) {
    plant=Blocks.cactus.getDefaultState();
  }
  return plant;
}
Program: 80784
Project: 80784
Buggy source:
@Override public boolean validBlock(World worldObj,ItemStack itemStack,Point3I point){
  Block plant=getPlantBlock(worldObj,itemStack,point);
  if (plant != null) {
    return (plant.canPlaceBlockAt(worldObj,point.getX(),point.getY(),point.getZ())) && (worldObj.getBlock(point.getX(),point.getY(),point.getZ()) != plant);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean validBlock(World worldObj,ItemStack itemStack,Point3I point){
  IBlockState plant=getPlantBlock(worldObj,itemStack,point);
  if (plant != null) {
    return (plant.getBlock().canPlaceBlockAt(worldObj,point.toPosition())) && (worldObj.getBlockState(point.toPosition()) != plant);
  }
  return false;
}
Program: 80785
Project: 80785
Buggy source:
public boolean isItemValidForSlot(int slot,ItemStack stack){
  return false;
}

Fixed version (ground truth):
public boolean isItemValidForSlot(int slot,ItemStack stack){
  if ((slot == SLOT_FUEL) && (TileEntityFurnace.getItemBurnTime(stack) > 0) && (ToolHelper.getType(stack.getItem()) == -1)) {
    return true;
  }
  return false;
}
Program: 80786
Project: 80786
Buggy source:
public boolean isItemValidForSlot(int slot,ItemStack stack){
  if ((slot == SLOT_PICKAXE) && (ToolHelper.getType(stack.getItem()) == ToolHelper.TYPE_PICKAXE)) {
    if (ToolHelper.getLevel(stack) <= getUpgradeLevel()) {
      return true;
    }
  }
 else   if ((slot == SLOT_SHOVEL) && (ToolHelper.getType(stack.getItem()) == ToolHelper.TYPE_SHOVEL)) {
    if (ToolHelper.getLevel(stack) <= getUpgradeLevel()) {
      return true;
    }
  }
 else   if ((slot == SLOT_AXE) && (ToolHelper.getType(stack.getItem()) == ToolHelper.TYPE_AXE)) {
    if (ToolHelper.getLevel(stack) <= getUpgradeLevel()) {
      return true;
    }
  }
 else   if ((slot == SLOT_SWORD) && (ToolHelper.getType(stack.getItem()) == ToolHelper.TYPE_SWORD)) {
    if (ToolHelper.getLevel(stack) <= getUpgradeLevel()) {
      return true;
    }
  }
 else   if ((slot == SLOT_HOE) && (ToolHelper.getType(stack.getItem()) == ToolHelper.TYPE_HOE)) {
    if (ToolHelper.getLevel(stack) <= getUpgradeLevel()) {
      return true;
    }
  }
 else   if ((slot == SLOT_FUEL) && (TileEntityFurnace.getItemBurnTime(stack) > 0) && (ToolHelper.getType(stack.getItem()) == -1)) {
    return true;
  }
 else   if ((slot == SLOT_UPGRADE) && (stack.isItemEqual(ToolHelper.getUpgradeType(getUpgradeLevel())))) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean isItemValidForSlot(int slot,ItemStack stack){
  if ((slot == SLOT_PICKAXE) && (ToolHelper.getType(stack.getItem()) == ToolHelper.TYPE_PICKAXE)) {
    if (ToolHelper.getLevel(stack) <= getUpgradeLevel()) {
      return true;
    }
  }
 else   if ((slot == SLOT_SHOVEL) && (ToolHelper.getType(stack.getItem()) == ToolHelper.TYPE_SHOVEL)) {
    if (ToolHelper.getLevel(stack) <= getUpgradeLevel()) {
      return true;
    }
  }
 else   if ((slot == SLOT_AXE) && (ToolHelper.getType(stack.getItem()) == ToolHelper.TYPE_AXE)) {
    if (ToolHelper.getLevel(stack) <= getUpgradeLevel()) {
      return true;
    }
  }
 else   if ((slot == SLOT_SWORD) && (ToolHelper.getType(stack.getItem()) == ToolHelper.TYPE_SWORD)) {
    if (ToolHelper.getLevel(stack) <= getUpgradeLevel()) {
      return true;
    }
  }
 else   if ((slot == SLOT_HOE) && (ToolHelper.getType(stack.getItem()) == ToolHelper.TYPE_HOE)) {
    if (ToolHelper.getLevel(stack) <= getUpgradeLevel()) {
      return true;
    }
  }
 else   if ((slot == SLOT_UPGRADE) && (stack.isItemEqual(ToolHelper.getUpgradeType(getUpgradeLevel())))) {
    return true;
  }
  return super.isItemValidForSlot(slot,stack);
}
Program: 80787
Project: 80787
Buggy source:
public int canMineBlock(int x,int y,int z){
  Block tryBlock=worldObj.getBlock(x,y,z);
  if (tryBlock != null) {
    int meta=worldObj.getBlockMetadata(x,y,z);
    if ((tryBlock.getBlockHardness(worldObj,x,y,z) >= 0) && (!tryBlock.isAir(worldObj,x,y,z))) {
      boolean mine=false;
      if (tryBlock == Blocks.cobblestone) {
        return -1;
      }
      if ((tryBlock.getHarvestTool(meta) == "String_Node_Str") || (tryBlock.getHarvestTool(meta) == "String_Node_Str")) {
        if (ForgeHooks.canToolHarvestBlock(tryBlock,meta,getStackInSlot(2))) {
          return 2;
        }
      }
 else       if (tryBlock.getHarvestTool(meta) == "String_Node_Str") {
        if (ForgeHooks.canToolHarvestBlock(tryBlock,meta,getStackInSlot(3))) {
          return 3;
        }
      }
 else {
        if (!tryBlock.getMaterial().isLiquid()) {
          return 1;
        }
      }
    }
    if (hasUpgrade(UpgradeType.FILLER)) {
      if ((tryBlock.isAir(worldObj,x,y,z)) || (tryBlock.getMaterial().isLiquid())) {
        return 4;
      }
    }
  }
  return 0;
}

Fixed version (ground truth):
public int canMineBlock(int x,int y,int z){
  Block tryBlock=worldObj.getBlock(x,y,z);
  if (tryBlock != null) {
    int meta=worldObj.getBlockMetadata(x,y,z);
    if ((tryBlock.getBlockHardness(worldObj,x,y,z) >= 0) && (!tryBlock.isAir(worldObj,x,y,z))) {
      boolean mine=false;
      if (tryBlock == Blocks.cobblestone) {
        return -1;
      }
      if (tryBlock.getHarvestTool(meta) == "String_Node_Str") {
        return 2;
      }
 else       if (tryBlock.getHarvestTool(meta) == "String_Node_Str") {
        if (ForgeHooks.canToolHarvestBlock(tryBlock,meta,getStackInSlot(2))) {
          return 2;
        }
      }
 else       if (tryBlock.getHarvestTool(meta) == "String_Node_Str") {
        if (ForgeHooks.canToolHarvestBlock(tryBlock,meta,getStackInSlot(3))) {
          return 3;
        }
      }
 else {
        if (!tryBlock.getMaterial().isLiquid()) {
          return 1;
        }
      }
    }
    if (hasUpgrade(UpgradeType.FILLER)) {
      if ((tryBlock.isAir(worldObj,x,y,z)) || (tryBlock.getMaterial().isLiquid())) {
        return 4;
      }
    }
  }
  return 0;
}
Program: 80788
Project: 80788
Buggy source:
public void updateEntity(){
  super.updateEntity();
  if (!worldObj.isRemote) {
    if (!isBurning()) {
      if (readyToBurn()) {
        if (slots[SLOT_FUEL] != null) {
          if (isFuel()) {
            burnLevel=progress=getBurnTime();
            if (slots[SLOT_FUEL].getItem().hasContainerItem(slots[SLOT_FUEL])) {
              slots[SLOT_FUEL]=slots[SLOT_FUEL].getItem().getContainerItem(slots[SLOT_FUEL]);
            }
 else {
              slots[SLOT_FUEL].stackSize--;
              if (slots[SLOT_FUEL].stackSize == 0) {
                slots[SLOT_FUEL]=null;
              }
            }
          }
 else           if (hasEngine()) {
            if (useEnergy(PAConfig.rfCost,false) > 0) {
              burnLevel=progress=1;
            }
          }
        }
      }
    }
 else {
      progress--;
      if (progress <= 0) {
        burnLevel=progress=0;
        if ((readyToBurn()) && (hasEngine())) {
          if (useEnergy(PAConfig.rfCost,false) > 0) {
            burnLevel=progress=1;
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void updateEntity(){
  super.updateEntity();
  if (!worldObj.isRemote) {
    if (!isBurning()) {
      if (readyToBurn()) {
        if (slots[SLOT_FUEL] != null) {
          if (isFuel()) {
            burnLevel=progress=getBurnTime();
            if (slots[SLOT_FUEL].getItem().hasContainerItem(slots[SLOT_FUEL])) {
              slots[SLOT_FUEL]=slots[SLOT_FUEL].getItem().getContainerItem(slots[SLOT_FUEL]);
            }
 else {
              slots[SLOT_FUEL].stackSize--;
              if (slots[SLOT_FUEL].stackSize == 0) {
                slots[SLOT_FUEL]=null;
              }
            }
          }
 else           if (hasEngine()) {
            if (useEnergy(PAConfig.rfCost,false) > 0) {
              burnLevel=progress=1;
            }
          }
        }
      }
    }
 else {
      progress--;
      if (progress <= 0) {
        burnLevel=progress=0;
        if ((readyToBurn()) && (hasEngine())) {
          if (useEnergy(PAConfig.rfCost,false) > 0) {
            burnLevel=progress=1;
          }
        }
      }
    }
    checkForPowerChange();
  }
}
Program: 80789
Project: 80789
Buggy source:
public void scanBlocks(){
  totalMineBlocks=currentMineBlocks=0;
  for (int i=1; i <= getRange(); i++) {
    Point2I currentPoint=spiral(i,xCoord,zCoord);
    boolean bedrock=false;
    int newY=this.yCoord - 1;
    while (!bedrock) {
      int result=canMineBlock(currentPoint.getX(),newY,currentPoint.getY());
      if (result >= 1) {
        totalMineBlocks++;
      }
 else       if (result == -1) {
        totalMineBlocks++;
        currentMineBlocks++;
      }
      newY--;
      if (newY < 0)       bedrock=true;
    }
  }
}

Fixed version (ground truth):
public void scanBlocks(){
  totalMineBlocks=currentMineBlocks=0;
  for (int i=1; i <= getRange(); i++) {
    Point2I currentPoint=spiral(i,xCoord,zCoord);
    boolean bedrock=false;
    int newY=this.yCoord - 1;
    while (!bedrock) {
      int result=canMineBlock(currentPoint.getX(),newY,currentPoint.getY());
      if (result >= 1) {
        totalMineBlocks++;
      }
 else       if (result == -1) {
        totalMineBlocks++;
        currentMineBlocks++;
      }
      newY--;
      if (newY < 0)       bedrock=true;
    }
  }
  notifyUpdate();
}
Program: 80790
Project: 80790
Buggy source:
public Block getNextBlock(){
  Point2I currentPoint=spiral(currentColumn,xCoord,zCoord);
  miningWith=canMineBlock(currentPoint.getX(),currentYLevel,currentPoint.getY());
  while ((miningWith <= 0) && (currentYLevel >= 0)) {
    if (miningWith > 0) {
      return worldObj.getBlock(currentPoint.getX(),currentYLevel,currentPoint.getY());
    }
 else {
      currentYLevel--;
      miningWith=canMineBlock(currentPoint.getX(),currentYLevel,currentPoint.getY());
    }
  }
  if (miningWith > 0) {
    return worldObj.getBlock(currentPoint.getX(),currentYLevel,currentPoint.getY());
  }
  if (currentYLevel < 0) {
    currentYLevel=yCoord - 1;
    currentColumn--;
    if (currentColumn < 0) {
      scanBlocks();
      currentColumn=getRange();
    }
 else {
      return getNextBlock();
    }
  }
  return null;
}

Fixed version (ground truth):
public Block getNextBlock(){
  Point2I currentPoint=spiral(currentColumn,xCoord,zCoord);
  miningWith=canMineBlock(currentPoint.getX(),currentYLevel,currentPoint.getY());
  while ((miningWith <= 0) && (currentYLevel >= 0)) {
    if (miningWith > 0) {
      return worldObj.getBlock(currentPoint.getX(),currentYLevel,currentPoint.getY());
    }
 else {
      currentYLevel--;
      if (currentYLevel >= 0)       miningWith=canMineBlock(currentPoint.getX(),currentYLevel,currentPoint.getY());
    }
  }
  if (miningWith > 0) {
    return worldObj.getBlock(currentPoint.getX(),currentYLevel,currentPoint.getY());
  }
  if (currentYLevel < 0) {
    currentYLevel=yCoord - 1;
    currentColumn--;
    if (currentColumn < 0) {
      scanBlocks();
      currentColumn=getRange();
    }
 else {
      return getNextBlock();
    }
  }
  return null;
}
Program: 80791
Project: 80791
Buggy source:
public int canMineBlock(int x,int y,int z){
  Block tryBlock=worldObj.getBlock(x,y,z);
  if (tryBlock != null) {
    int meta=worldObj.getBlockMetadata(x,y,z);
    if ((tryBlock.getBlockHardness(worldObj,x,y,z) >= 0) && (!tryBlock.isAir(worldObj,x,y,z))) {
      boolean mine=false;
      if (tryBlock == Blocks.cobblestone) {
        return -1;
      }
      if ((tryBlock.getHarvestTool(meta) == "String_Node_Str") || (tryBlock.getHarvestTool(meta) == "String_Node_Str")) {
        if (ForgeHooks.canToolHarvestBlock(tryBlock,meta,getStackInSlot(2))) {
          return 2;
        }
      }
 else       if (tryBlock.getHarvestTool(meta) == "String_Node_Str") {
        if (ForgeHooks.canToolHarvestBlock(tryBlock,meta,getStackInSlot(3))) {
          return 3;
        }
      }
 else {
        if (!tryBlock.getMaterial().isLiquid()) {
          return 4;
        }
      }
    }
    if (this.hasFillerUpgrade) {
      if ((tryBlock.isAir(worldObj,x,y,z)) || (tryBlock.getMaterial().isLiquid())) {
        return 4;
      }
    }
  }
  return 0;
}

Fixed version (ground truth):
public int canMineBlock(int x,int y,int z){
  Block tryBlock=worldObj.getBlock(x,y,z);
  if (tryBlock != null) {
    int meta=worldObj.getBlockMetadata(x,y,z);
    if ((tryBlock.getBlockHardness(worldObj,x,y,z) >= 0) && (!tryBlock.isAir(worldObj,x,y,z))) {
      boolean mine=false;
      if (tryBlock == Blocks.cobblestone) {
        return -1;
      }
      if ((tryBlock.getHarvestTool(meta) == "String_Node_Str") || (tryBlock.getHarvestTool(meta) == "String_Node_Str")) {
        if (ForgeHooks.canToolHarvestBlock(tryBlock,meta,getStackInSlot(2))) {
          return 2;
        }
      }
 else       if (tryBlock.getHarvestTool(meta) == "String_Node_Str") {
        if (ForgeHooks.canToolHarvestBlock(tryBlock,meta,getStackInSlot(3))) {
          return 3;
        }
      }
 else {
        if (!tryBlock.getMaterial().isLiquid()) {
          return 1;
        }
      }
    }
    if (this.hasFillerUpgrade) {
      if ((tryBlock.isAir(worldObj,x,y,z)) || (tryBlock.getMaterial().isLiquid())) {
        return 4;
      }
    }
  }
  return 0;
}
Program: 80793
Project: 80793
Buggy source:
public void updateEntity(){
  super.updateEntity();
  if (!worldObj.isRemote) {
    checkInventory();
    checkForChanges();
    if (isBurning()) {
      if (searchBlock > -1) {
        if (currentTime > 0) {
          if (checkPlant(searchBlock)) {
            currentTime--;
            if (currentTime <= 0) {
              harvestPlant(searchBlock);
              searchBlock=-1;
            }
          }
 else {
            currentTime=0;
          }
        }
 else         if (plantSeed(searchBlock,true)) {
          searchBlock=-1;
        }
 else {
          if (checkPlant(searchBlock)) {
            currentTime=harvestTime;
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void updateEntity(){
  super.updateEntity();
  if (!worldObj.isRemote) {
    checkInventory();
    checkForChanges();
    if (isBurning()) {
      if (searchBlock > -1) {
        if (currentTime > 0) {
          if (checkPlant(searchBlock)) {
            currentTime--;
            if (currentTime <= 0) {
              harvestPlant(searchBlock);
              searchBlock=-1;
            }
          }
 else {
            currentTime=0;
          }
        }
 else         if (plantSeed(searchBlock,true)) {
          searchBlock=-1;
        }
 else {
          if (checkPlant(searchBlock)) {
            currentTime=harvestTime;
          }
        }
      }
 else {
        doSearch();
      }
    }
  }
}
Program: 80794
Project: 80794
Buggy source:
public static void init(){
  for (int i=0; i <= 3; i++) {
    if (PAConfig.allowLevel(i)) {
      miner[i].init();
      chopper[i].init();
      planter[i].init();
      generator[i].init();
    }
  }
}

Fixed version (ground truth):
public static void init(){
  for (int i=0; i <= 3; i++) {
    if (PAConfig.allowLevel(i)) {
      if (PAConfig.minerEnabled)       miner[i].init();
      if (PAConfig.chopperEnabled)       chopper[i].init();
      if (PAConfig.planterEnabled)       planter[i].init();
      if (PAConfig.generatorEnabled && PAConfig.rfSupport)       generator[i].init();
    }
  }
}
Program: 80795
Project: 80795
Buggy source:
public static void preInit(){
  for (int i=0; i <= 3; i++) {
    if (PAConfig.allowLevel(i)) {
      if (PAConfig.minerEnabled)       miner[i]=new BlockMiner(i);
      if (PAConfig.chopperEnabled)       chopper[i]=new BlockChopper(i);
      if (PAConfig.planterEnabled)       planter[i]=new BlockPlanter(i);
      if (PAConfig.generatorEnabled && PAConfig.rfSupport)       generator[i]=new BlockGenerator(i);
    }
  }
  for (int i=0; i <= 3; i++) {
    if (PAConfig.allowLevel(i)) {
      miner[i].preInit();
      chopper[i].preInit();
      planter[i].preInit();
      generator[i].preInit();
    }
  }
}

Fixed version (ground truth):
public static void preInit(){
  for (int i=0; i <= 3; i++) {
    if (PAConfig.allowLevel(i)) {
      if (PAConfig.minerEnabled)       miner[i]=new BlockMiner(i);
      if (PAConfig.chopperEnabled)       chopper[i]=new BlockChopper(i);
      if (PAConfig.planterEnabled)       planter[i]=new BlockPlanter(i);
      if (PAConfig.generatorEnabled && PAConfig.rfSupport)       generator[i]=new BlockGenerator(i);
    }
  }
  for (int i=0; i <= 3; i++) {
    if (PAConfig.allowLevel(i)) {
      if (PAConfig.minerEnabled)       miner[i].preInit();
      if (PAConfig.chopperEnabled)       chopper[i].preInit();
      if (PAConfig.planterEnabled)       planter[i].preInit();
      if (PAConfig.generatorEnabled && PAConfig.rfSupport)       generator[i].preInit();
    }
  }
}
Program: 80796
Project: 80796
Buggy source:
public static void postInit(){
  for (int i=0; i <= 3; i++) {
    if (PAConfig.allowLevel(i)) {
      miner[i].postInit();
      chopper[i].postInit();
      planter[i].postInit();
      generator[i].postInit();
    }
  }
}

Fixed version (ground truth):
public static void postInit(){
  for (int i=0; i <= 3; i++) {
    if (PAConfig.allowLevel(i)) {
      if (PAConfig.minerEnabled)       miner[i].postInit();
      if (PAConfig.chopperEnabled)       chopper[i].postInit();
      if (PAConfig.planterEnabled)       planter[i].postInit();
      if (PAConfig.generatorEnabled && PAConfig.rfSupport)       generator[i].postInit();
    }
  }
}
Program: 80797
Project: 80797
Buggy source:
public static void preInit(){
  if (PAConfig.allowWoodenLevel)   woodUpgrade=new ItemWoodUpgrade();
  if (PAConfig.allowStoneLevel)   stoneUpgrade=new ItemStoneUpgrade();
  if (PAConfig.allowIronLevel)   ironUpgrade=new ItemIronUpgrade();
  if (PAConfig.allowDiamondLevel)   diamondUpgrade=new ItemDiamondUpgrade();
  if (PAConfig.allowCobbleUpgrade)   cobbleUpgrade=new ItemCobbleGenUpgrade();
  if (PAConfig.allowWitherUpgrade)   witherUpgrade=new ItemWitherUpgrade();
  if (PAConfig.allowCoalPellets)   coalPellet=new ItemCoalPellet();
  if (PAConfig.rfSupport) {
    rfEngine=new ItemRFEngine();
    CheatRFEngine=new ItemCreativeRFEngine();
  }
  if (woodUpgrade != null)   woodUpgrade.preInit();
  if (stoneUpgrade != null)   stoneUpgrade.preInit();
  if (ironUpgrade != null)   ironUpgrade.preInit();
  if (diamondUpgrade != null)   diamondUpgrade.preInit();
  if (witherUpgrade != null)   witherUpgrade.preInit();
  if (PAConfig.rfSupport) {
    rfEngine.preInit();
    CheatRFEngine.preInit();
  }
  if (coalPellet != null)   coalPellet.preInit();
}

Fixed version (ground truth):
public static void preInit(){
  if (PAConfig.allowWoodenLevel)   woodUpgrade=new ItemWoodUpgrade();
  if (PAConfig.allowStoneLevel)   stoneUpgrade=new ItemStoneUpgrade();
  if (PAConfig.allowIronLevel)   ironUpgrade=new ItemIronUpgrade();
  if (PAConfig.allowDiamondLevel)   diamondUpgrade=new ItemDiamondUpgrade();
  if ((PAConfig.allowCobbleUpgrade) && (PAConfig.minerEnabled))   cobbleUpgrade=new ItemCobbleGenUpgrade();
  if (PAConfig.allowWitherUpgrade)   witherUpgrade=new ItemWitherUpgrade();
  if (PAConfig.allowCoalPellets)   coalPellet=new ItemCoalPellet();
  if (PAConfig.rfSupport) {
    rfEngine=new ItemRFEngine();
    CheatRFEngine=new ItemCreativeRFEngine();
  }
  if (woodUpgrade != null)   woodUpgrade.preInit();
  if (stoneUpgrade != null)   stoneUpgrade.preInit();
  if (ironUpgrade != null)   ironUpgrade.preInit();
  if (diamondUpgrade != null)   diamondUpgrade.preInit();
  if (witherUpgrade != null)   witherUpgrade.preInit();
  if (PAConfig.rfSupport) {
    rfEngine.preInit();
    CheatRFEngine.preInit();
  }
  if (coalPellet != null)   coalPellet.preInit();
}
Program: 80798
Project: 80798
Buggy source:
public boolean canInsertItem(int slot,ItemStack stack,int side){
  if (slots[slot] != null) {
    int availSpace=this.getInventoryStackLimit() - slots[slot].stackSize;
    if (availSpace > 0) {
      return true;
    }
  }
 else {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean canInsertItem(int slot,ItemStack stack,int side){
  if (slots[slot] != null) {
    int availSpace=this.getInventoryStackLimit() - slots[slot].stackSize;
    if (availSpace > 0) {
      return true;
    }
  }
 else   if (isItemValidForSlot(slot,stack)) {
    return true;
  }
  return false;
}
Program: 80799
Project: 80799
Buggy source:
public void checkForChanges(){
  boolean update=false;
  if ((slots[2] == null) && (lastPick >= 0)) {
    lastPick=-1;
    update=true;
  }
 else   if (slots[2] != null) {
    if (ToolInfo.getLevel(slots[2].getItem()) != lastPick) {
      lastPick=ToolInfo.getLevel(slots[2].getItem());
      update=true;
    }
  }
  if ((slots[3] == null) && (lastShovel >= 0)) {
    lastShovel=-1;
    update=true;
  }
 else   if (slots[3] != null) {
    if (ToolInfo.getLevel(slots[3].getItem()) != lastShovel) {
      lastShovel=ToolInfo.getLevel(slots[3].getItem());
      update=true;
    }
  }
  if (getCurrentUpgrades() != lastUpgrades) {
    addUpgrades(getCurrentUpgrades());
    slots[4]=null;
    lastUpgrades=getCurrentUpgrades();
    update=true;
  }
  if (update) {
    scanBlocks();
    currentColumn=getRange();
    currentBlock=null;
    miningTime=0;
    currentYLevel=yCoord - 1;
  }
}

Fixed version (ground truth):
public void checkForChanges(){
  boolean update=false;
  if ((slots[2] == null) && (lastPick >= 0)) {
    lastPick=-1;
    update=true;
  }
 else   if (slots[2] != null) {
    if (ToolInfo.getLevel(slots[2].getItem()) != lastPick) {
      lastPick=ToolInfo.getLevel(slots[2].getItem());
      update=true;
    }
  }
  if ((slots[3] == null) && (lastShovel >= 0)) {
    lastShovel=-1;
    update=true;
  }
 else   if (slots[3] != null) {
    if (ToolInfo.getLevel(slots[3].getItem()) != lastShovel) {
      lastShovel=ToolInfo.getLevel(slots[3].getItem());
      update=true;
    }
  }
  if (getCurrentUpgrades() != lastUpgrades) {
    if (slots[4].isItemEqual(ToolInfo.getUpgradeType(mineLevel))) {
      addUpgrades(getCurrentUpgrades());
      slots[4]=null;
      lastUpgrades=getCurrentUpgrades();
      update=true;
    }
  }
  if (update) {
    scanBlocks();
    currentColumn=getRange();
    currentBlock=null;
    miningTime=0;
    currentYLevel=yCoord - 1;
  }
}
Program: 80800
Project: 80800
Buggy source:
public int readLEInt(){
  ByteBuffer buffer=_read(4,true);
  return buffer.getInt();
}

Fixed version (ground truth):
public int readLEInt(){
  ByteBuffer buffer=_read(4,true);
  ThreadUtil.sleep(1);
  return buffer.getInt();
}
Program: 80801
Project: 80801
Buggy source:
private ByteBuffer _read(int i,boolean strict){
  ByteBuffer buffer=ByteBuffer.allocate(i);
  buffer.order(ByteOrder.LITTLE_ENDIAN);
  try {
    int read=socketChannel.read(buffer);
    if (read != i && strict) {
      throw new RethinkDBException("String_Node_Str" + i + "String_Node_Str"+ read);
    }
    buffer.flip();
    return buffer;
  }
 catch (  IOException e) {
    throw new RethinkDBException(e);
  }
}

Fixed version (ground truth):
private ByteBuffer _read(int i,boolean strict){
  ByteBuffer buffer=ByteBuffer.allocate(i);
  buffer.order(ByteOrder.LITTLE_ENDIAN);
  try {
    int totalRead=0;
    int read=socketChannel.read(buffer);
    totalRead+=read;
    while (strict && read != 0 && read != i) {
      read=socketChannel.read(buffer);
      totalRead+=read;
    }
    if (totalRead != i && strict) {
      throw new RethinkDBException("String_Node_Str" + i + "String_Node_Str"+ totalRead);
    }
    buffer.flip();
    return buffer;
  }
 catch (  IOException e) {
    throw new RethinkDBException(e);
  }
}
Program: 80802
Project: 80802
Buggy source:
public SetInsert setInsert(List<Object> objects){
  return new SetInsert(null,new Arguments(objects),null);
}

Fixed version (ground truth):
public SetInsert setInsert(List<Object> objects){
  return new SetInsert(this,new Arguments(objects),null);
}
Program: 80803
Project: 80803
Buggy source:
public SetIntersection setIntersection(List<Object> objects){
  return new SetIntersection(null,new Arguments(objects),null);
}

Fixed version (ground truth):
public SetIntersection setIntersection(List<Object> objects){
  return new SetIntersection(this,new Arguments(objects),null);
}
Program: 80804
Project: 80804
Buggy source:
public SetDifference setDifference(List<Object> objects){
  return new SetDifference(null,new Arguments(objects),null);
}

Fixed version (ground truth):
public SetDifference setDifference(List<Object> objects){
  return new SetDifference(this,new Arguments(objects),null);
}
Program: 80805
Project: 80805
Buggy source:
public SetUnion setUnion(List<Object> objects){
  return new SetUnion(null,new Arguments(objects),null);
}

Fixed version (ground truth):
public SetUnion setUnion(List<Object> objects){
  return new SetUnion(this,new Arguments(objects),null);
}
Program: 80809
Project: 80809
Buggy source:
@Override public Map<String,Float> execute(Jedis jedis,String key,SolrParams params){
  final String min=ParamUtil.getStringByName(params,"String_Node_Str","String_Node_Str");
  final String max=ParamUtil.getStringByName(params,"String_Node_Str","String_Node_Str");
  log.debug("String_Node_Str",key,min,max);
  return Command.ResultUtil.tupleIteratorToMap(jedis.zrangeByScoreWithScores(key,max,min));
}

Fixed version (ground truth):
@Override public Map<String,Float> execute(Jedis jedis,String key,SolrParams params){
  final String min=ParamUtil.getStringByName(params,"String_Node_Str","String_Node_Str");
  final String max=ParamUtil.getStringByName(params,"String_Node_Str","String_Node_Str");
  log.debug("String_Node_Str",key,min,max);
  return Command.ResultUtil.tupleIteratorToMap(jedis.zrangeByScoreWithScores(key,min,max));
}
Program: 80810
Project: 80810
Buggy source:
@Override public Map<String,Float> execute(Jedis jedis,String key,SolrParams params){
  final String min=ParamUtil.getStringByName(params,"String_Node_Str","String_Node_Str");
  final String max=ParamUtil.getStringByName(params,"String_Node_Str","String_Node_Str");
  log.debug("String_Node_Str",key,min,max);
  return Command.ResultUtil.tupleIteratorToMap(jedis.zrangeByScoreWithScores(key,max,min));
}

Fixed version (ground truth):
@Override public Map<String,Float> execute(Jedis jedis,String key,SolrParams params){
  final String min=ParamUtil.getStringByName(params,"String_Node_Str","String_Node_Str");
  final String max=ParamUtil.getStringByName(params,"String_Node_Str","String_Node_Str");
  log.debug("String_Node_Str",key,min,max);
  return Command.ResultUtil.tupleIteratorToMap(jedis.zrangeByScoreWithScores(key,min,max));
}
Program: 80811
Project: 80811
Buggy source:
@Override public Query parse() throws SyntaxError {
  String fieldName=localParams.get(QueryParsing.V);
  BooleanQuery booleanQuery=new BooleanQuery(true);
  int booleanClausesTotal=0;
  log.debug("String_Node_Str" + redisObjectsCollection.size() + "String_Node_Str"+ fieldName);
  for (  String termString : redisObjectsCollection) {
    try {
      TokenStream tokenStream=req.getSchema().getQueryAnalyzer().tokenStream(fieldName,termString);
      BytesRef term=new BytesRef();
      if (tokenStream != null) {
        CharTermAttribute charAttribute=tokenStream.addAttribute(CharTermAttribute.class);
        tokenStream.reset();
        int counter=0;
        while (tokenStream.incrementToken()) {
          log.trace("String_Node_Str",++counter,termString,fieldName);
          term=new BytesRef(charAttribute);
          TermQuery termQuery=new TermQuery(new Term(fieldName,term));
          booleanQuery.add(termQuery,this.operator);
          ++booleanClausesTotal;
        }
        tokenStream.end();
        tokenStream.close();
      }
 else {
        term.copyChars(termString);
        TermQuery termQuery=new TermQuery(new Term(fieldName,term));
        booleanQuery.add(termQuery,this.operator);
        ++booleanClausesTotal;
      }
    }
 catch (    IOException ex) {
      log.error("String_Node_Str",ex);
    }
  }
  log.debug("String_Node_Str",booleanClausesTotal);
  return booleanQuery;
}

Fixed version (ground truth):
@Override public Query parse() throws SyntaxError {
  String fieldName=localParams.get(QueryParsing.V);
  BooleanQuery booleanQuery=new BooleanQuery(true);
  int booleanClausesTotal=0;
  if (redisObjectsCollection != null) {
    log.debug("String_Node_Str" + redisObjectsCollection.size() + "String_Node_Str"+ fieldName);
    for (    String termString : redisObjectsCollection) {
      try {
        TokenStream tokenStream=req.getSchema().getQueryAnalyzer().tokenStream(fieldName,termString);
        BytesRef term=new BytesRef();
        if (tokenStream != null) {
          CharTermAttribute charAttribute=tokenStream.addAttribute(CharTermAttribute.class);
          tokenStream.reset();
          int counter=0;
          while (tokenStream.incrementToken()) {
            log.trace("String_Node_Str",++counter,termString,fieldName);
            term=new BytesRef(charAttribute);
            TermQuery termQuery=new TermQuery(new Term(fieldName,term));
            booleanQuery.add(termQuery,this.operator);
            ++booleanClausesTotal;
          }
          tokenStream.end();
          tokenStream.close();
        }
 else {
          term.copyChars(termString);
          TermQuery termQuery=new TermQuery(new Term(fieldName,term));
          booleanQuery.add(termQuery,this.operator);
          ++booleanClausesTotal;
        }
      }
 catch (      IOException ex) {
        log.error("String_Node_Str",ex);
      }
    }
  }
  log.debug("String_Node_Str",booleanClausesTotal);
  return booleanQuery;
}
Program: 80812
Project: 80812
Buggy source:
protected boolean hasMore(){
  return reader.getFilePointer() < split.getEnd();
}

Fixed version (ground truth):
protected boolean hasMore(){
  return reader.getFilePointer() <= split.getEnd();
}
Program: 80813
Project: 80813
Buggy source:
/** 
 * Starts the session checker on a polling interval.
 * @param interval the checking interval
 */
protected abstract void startSessionChecker(final long interval);

Fixed version (ground truth):
/** 
 * Starts the session checker on a polling interval.
 * @param interval the checking interval
 */
public abstract void startSessionChecker(final long interval);
Program: 80814
Project: 80814
Buggy source:
/** 
 * Builds and adds a finalized payload by adding in extra information to the payload: - The event contexts - The Tracker Subject - The Tracker parameters
 * @param payload Payload the raw event payload to bedecorated.
 * @param context The raw context list
 */
private void addEventPayload(Payload payload,List<SelfDescribingJson> context){
  payload.add(Parameters.PLATFORM,this.devicePlatform.toString());
  payload.add(Parameters.APPID,this.appId);
  payload.add(Parameters.NAMESPACE,this.namespace);
  payload.add(Parameters.TRACKER_VERSION,this.trackerVersion);
  if (this.subject != null) {
    payload.addMap(new HashMap<String,Object>(this.subject.getSubject()));
  }
  SelfDescribingJson envelope=getFinalContext(context);
  payload.addMap(envelope.getMap(),this.base64Encoded,Parameters.CONTEXT_ENCODED,Parameters.CONTEXT);
  Logger.v(TAG,"String_Node_Str",payload);
  this.emitter.add(payload);
}

Fixed version (ground truth):
/** 
 * Builds and adds a finalized payload by adding in extra information to the payload: - The event contexts - The Tracker Subject - The Tracker parameters
 * @param payload Payload the raw event payload to bedecorated.
 * @param context The raw context list
 */
private void addEventPayload(TrackerPayload payload,List<SelfDescribingJson> context){
  payload.add(Parameters.PLATFORM,this.devicePlatform.toString());
  payload.add(Parameters.APPID,this.appId);
  payload.add(Parameters.NAMESPACE,this.namespace);
  payload.add(Parameters.TRACKER_VERSION,this.trackerVersion);
  if (this.subject != null) {
    payload.addMap(new HashMap<String,Object>(this.subject.getSubject()));
  }
  SelfDescribingJson envelope=getFinalContext(context);
  payload.addMap(envelope.getMap(),this.base64Encoded,Parameters.CONTEXT_ENCODED,Parameters.CONTEXT);
  Logger.v(TAG,"String_Node_Str",payload);
  this.emitter.add(payload);
}
Program: 80815
Project: 80815
Buggy source:
/** 
 * Shuts down all concurrent services in the Tracker: - Emitter polling sender - Session polling checker
 */
public void shutdown(){
  this.shutdownEmitter();
  this.shutdownSessionChecker();
}

Fixed version (ground truth):
/** 
 * Shuts down all concurrent services in the Tracker: - Emitter polling sender - Session polling checker
 */
public void shutdown(){
  shutdownEmitter();
  shutdownSessionChecker();
}
Program: 80816
Project: 80816
Buggy source:
protected Event(Builder<?> builder){
  this.context=Util.getMutableList(builder.context);
  this.timestamp=builder.timestamp;
  this.eventId=builder.eventId;
}

Fixed version (ground truth):
protected Event(Builder<?> builder){
  this.context=builder.context;
  this.timestamp=builder.timestamp;
  this.eventId=builder.eventId;
}