nus-yam/ex-repair huggingface dataset:
Program: 156800
Project: 156800
Buggy source:
public GatePluggable(Gate gate){
  this.material=gate.material;
  this.logic=gate.logic;
  Set<IGateExpansion> gateExpansions=gate.expansions.keySet();
  this.expansions=gateExpansions.toArray(new IGateExpansion[gateExpansions.size()]);
}

Fixed version (ground truth):
public GatePluggable(Gate gate){
  instantiatedGate=gate;
  initFromGate(gate);
}
Program: 156801
Project: 156801
Buggy source:
public static void start(){
  for (  Fluid f : FluidRegistry.getRegisteredFluids().values()) {
    SchematicRegistry.INSTANCE.registerSchematicBlock(f.getBlock(),SchematicFluid.class,new FluidStack(f,1000));
  }
  Iterator i=Block.blockRegistry.iterator();
  while (i.hasNext()) {
    Block block=(Block)i.next();
    if (block == null || block == Blocks.air) {
      continue;
    }
    for (int meta=0; meta < 16; meta++) {
      if (!SchematicRegistry.INSTANCE.isSupported(block,meta)) {
        try {
          if (block.hasTileEntity(meta)) {
            SchematicRegistry.INSTANCE.registerSchematicBlock(block,meta,SchematicTileCreative.class);
            continue;
          }
          boolean creativeOnly=false;
          try {
            if (creativeOnly) {
              SchematicRegistry.INSTANCE.registerSchematicBlock(block,meta,SchematicBlockCreative.class);
            }
 else {
              SchematicRegistry.INSTANCE.registerSchematicBlock(block,meta,SchematicBlock.class);
            }
          }
 catch (          Exception e) {
            e.printStackTrace();
          }
        }
 catch (        Exception e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
public static void start(){
  Iterator i=Block.blockRegistry.iterator();
  while (i.hasNext()) {
    Block block=(Block)i.next();
    if (block == null || block == Blocks.air) {
      continue;
    }
    for (int meta=0; meta < 16; meta++) {
      if (!SchematicRegistry.INSTANCE.isSupported(block,meta)) {
        try {
          if (block.hasTileEntity(meta)) {
            SchematicRegistry.INSTANCE.registerSchematicBlock(block,meta,SchematicTileCreative.class);
            continue;
          }
          boolean creativeOnly=false;
          try {
            if (creativeOnly) {
              SchematicRegistry.INSTANCE.registerSchematicBlock(block,meta,SchematicBlockCreative.class);
            }
 else {
              if (block instanceof IFluidBlock) {
                IFluidBlock fblock=(IFluidBlock)block;
                if (fblock.getFluid() != null) {
                  SchematicRegistry.INSTANCE.registerSchematicBlock(block,meta,SchematicFluid.class,new FluidStack(fblock.getFluid(),1000));
                }
              }
 else {
                SchematicRegistry.INSTANCE.registerSchematicBlock(block,meta,SchematicBlock.class);
              }
            }
          }
 catch (          Exception e) {
            e.printStackTrace();
          }
        }
 catch (        Exception e) {
        }
      }
    }
  }
}
Program: 156802
Project: 156802
Buggy source:
public void registerSchematicBlock(Block block,int meta,Class<? extends Schematic> clazz,Object... params){
  if (block == null || Block.blockRegistry.getNameForObject(block) == null || "String_Node_Str".equals(Block.blockRegistry.getNameForObject(block))) {
    BCLog.logger.warn("String_Node_Str");
    return;
  }
  if (schematicBlocks.containsKey(toStringKey(block,meta))) {
    throw new RuntimeException("String_Node_Str" + Block.blockRegistry.getNameForObject(block) + "String_Node_Str");
  }
  schematicBlocks.put(toStringKey(block,meta),new SchematicConstructor(clazz,params));
}

Fixed version (ground truth):
public void registerSchematicBlock(Block block,int meta,Class<? extends Schematic> clazz,Object... params){
  if (block == null || Block.blockRegistry.getNameForObject(block) == null || "String_Node_Str".equals(Block.blockRegistry.getNameForObject(block))) {
    BCLog.logger.warn("String_Node_Str" + (block != null ? block.getClass().getName() : "String_Node_Str") + "String_Node_Str");
    return;
  }
  if (schematicBlocks.containsKey(toStringKey(block,meta))) {
    throw new RuntimeException("String_Node_Str" + Block.blockRegistry.getNameForObject(block) + "String_Node_Str");
  }
  schematicBlocks.put(toStringKey(block,meta),new SchematicConstructor(clazz,params));
}
Program: 156803
Project: 156803
Buggy source:
public BlockSpring(){
  super(Material.rock);
  setBlockUnbreakable();
  setResistance(6000000.0F);
  disableStats();
  setTickRandomly(true);
  setCreativeTab(CreativeTabBuildCraft.BLOCKS.get());
}

Fixed version (ground truth):
public BlockSpring(){
  super(Material.rock);
  setBlockUnbreakable();
  setResistance(6000000.0F);
  setStepSound(soundTypeStone);
  disableStats();
  setTickRandomly(true);
  setCreativeTab(CreativeTabBuildCraft.BLOCKS.get());
}
Program: 156804
Project: 156804
Buggy source:
public BptBuilderBase nextBuilder(){
  if (!returnedThis) {
    blueprint.adjustToWorld(world,x,y,x,dir);
    returnedThis=true;
    BptBuilderBase builder;
    if (blueprint instanceof Blueprint) {
      builder=new BptBuilderBlueprint((Blueprint)blueprint,world,x,y,z);
    }
 else     if (blueprint instanceof Template) {
      builder=new BptBuilderTemplate(blueprint,world,x,y,z);
    }
 else {
      return null;
    }
    box.initialize(builder);
    return builder;
  }
  blueprint=null;
  if (current != null) {
    BptBuilderBase builder=current.nextBuilder();
    if (builder != null) {
      return builder;
    }
  }
  if (nextSubBlueprint >= subBlueprints.size()) {
    return null;
  }
  NBTTagCompound nbt=subBlueprints.get(nextSubBlueprint);
  BlueprintBase bpt=BlueprintBase.loadBluePrint(nbt.getCompoundTag("String_Node_Str"));
  int nx=box.xMin + nbt.getInteger("String_Node_Str");
  int ny=box.yMin + nbt.getInteger("String_Node_Str");
  int nz=box.zMin + nbt.getInteger("String_Node_Str");
  ForgeDirection nbtDir=ForgeDirection.values()[nbt.getByte("String_Node_Str")];
  current=new RecursiveBlueprintBuilder(bpt,world,nx,ny,nz,nbtDir);
  nextSubBlueprint++;
  return current.nextBuilder();
}

Fixed version (ground truth):
public BptBuilderBase nextBuilder(){
  if (!returnedThis) {
    blueprint.adjustToWorld(world,x,y,z,dir);
    returnedThis=true;
    BptBuilderBase builder;
    if (blueprint instanceof Blueprint) {
      builder=new BptBuilderBlueprint((Blueprint)blueprint,world,x,y,z);
    }
 else     if (blueprint instanceof Template) {
      builder=new BptBuilderTemplate(blueprint,world,x,y,z);
    }
 else {
      return null;
    }
    box.initialize(builder);
    return builder;
  }
  blueprint=null;
  if (current != null) {
    BptBuilderBase builder=current.nextBuilder();
    if (builder != null) {
      return builder;
    }
  }
  if (nextSubBlueprint >= subBlueprints.size()) {
    return null;
  }
  NBTTagCompound nbt=subBlueprints.get(nextSubBlueprint);
  BlueprintBase bpt=BlueprintBase.loadBluePrint(nbt.getCompoundTag("String_Node_Str"));
  int nx=box.xMin + nbt.getInteger("String_Node_Str");
  int ny=box.yMin + nbt.getInteger("String_Node_Str");
  int nz=box.zMin + nbt.getInteger("String_Node_Str");
  ForgeDirection nbtDir=ForgeDirection.values()[nbt.getByte("String_Node_Str")];
  current=new RecursiveBlueprintBuilder(bpt,world,nx,ny,nz,nbtDir);
  nextSubBlueprint++;
  return current.nextBuilder();
}
Program: 156805
Project: 156805
Buggy source:
private WeakReference<EntityPlayer> createNewPlayer(WorldServer world,int x,int y,int z){
  EntityPlayer player=FakePlayerFactory.get(world,BuildCraftCore.gameProfile);
  player.posY=y;
  player.posZ=z;
  return new WeakReference<EntityPlayer>(player);
}

Fixed version (ground truth):
private WeakReference<EntityPlayer> createNewPlayer(WorldServer world,int x,int y,int z){
  EntityPlayer player=FakePlayerFactory.get(world,BuildCraftCore.gameProfile);
  player.posX=x;
  player.posY=y;
  player.posZ=z;
  return new WeakReference<EntityPlayer>(player);
}
Program: 156806
Project: 156806
Buggy source:
@Override public boolean get(IBlockAccess blockAccess,Block block,int meta,int x,int y,int z){
  if (block == null) {
    return false;
  }
 else {
    ItemStack stack=new ItemStack(block);
    if (stack.getItem() != null) {
      for (      int id : OreDictionary.getOreIDs(stack)) {
        if (id == leavesId) {
          return true;
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean get(IBlockAccess blockAccess,Block block,int meta,int x,int y,int z){
  if (block == null) {
    return false;
  }
 else {
    ItemStack stack=new ItemStack(block,1,meta);
    if (stack.getItem() != null) {
      for (      int id : OreDictionary.getOreIDs(stack)) {
        if (id == leavesId) {
          return true;
        }
      }
    }
  }
  return false;
}
Program: 156807
Project: 156807
Buggy source:
public BlockMiningWell(){
  super(Material.ground);
  setHardness(5F);
  setResistance(10F);
}

Fixed version (ground truth):
public BlockMiningWell(){
  super(Material.ground);
  setHardness(5F);
  setResistance(10F);
  setStepSound(soundTypeStone);
}
Program: 156808
Project: 156808
Buggy source:
public BlockQuarry(){
  super(Material.iron);
  setHardness(10F);
  setResistance(10F);
}

Fixed version (ground truth):
public BlockQuarry(){
  super(Material.iron);
  setHardness(10F);
  setResistance(10F);
  setStepSound(soundTypeAnvil);
}
Program: 156809
Project: 156809
Buggy source:
@Override public void writeToWorld(IBuilderContext context){
  if (mode == Mode.ClearIfInvalid) {
    if (!getSchematic().isAlreadyBuilt(context,x,y,z)) {
      context.world().setBlockToAir(x,y,z);
    }
  }
 else {
    try {
      getSchematic().placeInWorld(context,x,y,z,stackConsumed);
      TileEntity e=context.world().getTileEntity(x,y,z);
      if (e != null) {
        e.updateEntity();
      }
    }
 catch (    Throwable t) {
      t.printStackTrace();
      context.world().setBlockToAir(x,y,z);
    }
  }
}

Fixed version (ground truth):
@Override public void writeToWorld(IBuilderContext context){
  if (mode == Mode.ClearIfInvalid) {
    if (!getSchematic().isAlreadyBuilt(context,x,y,z)) {
      context.world().setBlockToAir(x,y,z);
    }
  }
 else {
    try {
      getSchematic().placeInWorld(context,x,y,z,stackConsumed);
      TileEntity e=context.world().getTileEntity(x,y,z);
      if (e != null) {
        e.updateEntity();
      }
      if (getSchematic() instanceof SchematicBlock) {
        SchematicBlock sb=(SchematicBlock)getSchematic();
        List<ItemStack> oldRequirements=Arrays.asList(sb.storedRequirements);
        sb.storedRequirements=new ItemStack[0];
        sb.storeRequirements(context,x,y,z);
        for (        ItemStack s : sb.storedRequirements) {
          if (!oldRequirements.contains(s)) {
            BCLog.logger.warn("String_Node_Str");
            context.world().setBlockToAir(x,y,z);
            return;
          }
        }
      }
    }
 catch (    Throwable t) {
      t.printStackTrace();
      context.world().setBlockToAir(x,y,z);
    }
  }
}
Program: 156811
Project: 156811
Buggy source:
@Override public void readSchematicFromNBT(NBTTagCompound nbt,MappingRegistry registry){
  super.readSchematicFromNBT(nbt,registry);
  readBlockFromNBT(nbt,registry);
  readRequirementsFromNBT(nbt,registry);
}

Fixed version (ground truth):
@Override public void readSchematicFromNBT(NBTTagCompound nbt,MappingRegistry registry){
  super.readSchematicFromNBT(nbt,registry);
  readBlockFromNBT(nbt,registry);
  if (!doNotUse()) {
    readRequirementsFromNBT(nbt,registry);
  }
}
Program: 156812
Project: 156812
Buggy source:
protected void readBlockFromNBT(NBTTagCompound nbt,MappingRegistry registry){
  try {
    block=registry.getBlockForId(nbt.getInteger("String_Node_Str"));
    meta=nbt.getInteger("String_Node_Str");
  }
 catch (  MappingNotFoundException e) {
    defaultPermission=BuildingPermission.CREATIVE_ONLY;
  }
}

Fixed version (ground truth):
protected void readBlockFromNBT(NBTTagCompound nbt,MappingRegistry registry){
  try {
    block=registry.getBlockForId(nbt.getInteger("String_Node_Str"));
    meta=nbt.getInteger("String_Node_Str");
  }
 catch (  MappingNotFoundException e) {
    doNotUse=true;
  }
}
Program: 156813
Project: 156813
Buggy source:
protected void readRequirementsFromNBT(NBTTagCompound nbt,MappingRegistry registry){
  if (nbt.hasKey("String_Node_Str")) {
    NBTTagList rq=nbt.getTagList("String_Node_Str",Constants.NBT.TAG_COMPOUND);
    ArrayList<ItemStack> rqs=new ArrayList<ItemStack>();
    for (int i=0; i < rq.tagCount(); ++i) {
      try {
        NBTTagCompound sub=rq.getCompoundTagAt(i);
        if (sub.getInteger("String_Node_Str") >= 0) {
          registry.stackToWorld(sub);
          rqs.add(ItemStack.loadItemStackFromNBT(sub));
        }
 else {
          defaultPermission=BuildingPermission.CREATIVE_ONLY;
        }
      }
 catch (      MappingNotFoundException e) {
        defaultPermission=BuildingPermission.CREATIVE_ONLY;
      }
catch (      Throwable t) {
        t.printStackTrace();
        defaultPermission=BuildingPermission.CREATIVE_ONLY;
      }
    }
    storedRequirements=rqs.toArray(new ItemStack[rqs.size()]);
  }
 else {
    storedRequirements=new ItemStack[0];
  }
}

Fixed version (ground truth):
protected void readRequirementsFromNBT(NBTTagCompound nbt,MappingRegistry registry){
  if (nbt.hasKey("String_Node_Str")) {
    NBTTagList rq=nbt.getTagList("String_Node_Str",Constants.NBT.TAG_COMPOUND);
    ArrayList<ItemStack> rqs=new ArrayList<ItemStack>();
    int idTEST=0;
    for (int i=0; i < rq.tagCount(); ++i) {
      try {
        NBTTagCompound sub=rq.getCompoundTagAt(i);
        idTEST=sub.getInteger("String_Node_Str");
        if (sub.getInteger("String_Node_Str") >= 0) {
          registry.stackToWorld(sub);
          rqs.add(ItemStack.loadItemStackFromNBT(sub));
        }
 else {
          defaultPermission=BuildingPermission.CREATIVE_ONLY;
        }
      }
 catch (      MappingNotFoundException e) {
        defaultPermission=BuildingPermission.CREATIVE_ONLY;
      }
catch (      Throwable t) {
        t.printStackTrace();
        defaultPermission=BuildingPermission.CREATIVE_ONLY;
      }
    }
    storedRequirements=rqs.toArray(new ItemStack[rqs.size()]);
  }
 else {
    storedRequirements=new ItemStack[0];
  }
}
Program: 156815
Project: 156815
Buggy source:
public void init(){
  if (gate == null) {
    return;
  }
  for (int y=0; y < 3; y++) {
    for (int x=0; x < 9; x++) {
      getSlot(x + y * 9).yDisplayPosition=gate.material.guiHeight - 84 + y * 18;
    }
  }
  for (int x=0; x < 9; x++) {
    getSlot(x + 27).yDisplayPosition=gate.material.guiHeight - 26;
  }
  if (!pipe.container.getWorldObj().isRemote) {
    potentialTriggers.addAll(gate.getAllValidTriggers());
    potentialActions.addAll(gate.getAllValidActions());
    if (gate.material.numTriggerParameters == 0) {
      Iterator<IStatement> it=potentialTriggers.iterator();
      while (it.hasNext()) {
        IStatement trigger=it.next();
        if (trigger.minParameters() > 0) {
          it.remove();
        }
      }
    }
    if (gate.material.numActionParameters == 0) {
      Iterator<IStatement> it=potentialActions.iterator();
      while (it.hasNext()) {
        IStatement action=it.next();
        if (action.minParameters() > 0) {
          it.remove();
        }
      }
    }
  }
  if (gateCallback != null) {
    gateCallback.setGate(gate);
  }
}

Fixed version (ground truth):
public void init(){
  if (gate == null) {
    return;
  }
  for (int y=0; y < 3; y++) {
    for (int x=0; x < 9; x++) {
      getSlot(x + y * 9).yDisplayPosition=gate.material.guiHeight - 84 + y * 18;
    }
  }
  for (int x=0; x < 9; x++) {
    getSlot(x + 27).yDisplayPosition=gate.material.guiHeight - 26;
  }
  if (!pipe.container.getWorldObj().isRemote) {
    potentialTriggers.addAll(gate.getAllValidTriggers());
    potentialActions.addAll(gate.getAllValidActions());
    Iterator<IStatement> it=potentialTriggers.iterator();
    while (it.hasNext()) {
      IStatement trigger=it.next();
      if (trigger.minParameters() > gate.material.numTriggerParameters) {
        it.remove();
      }
    }
    it=potentialActions.iterator();
    while (it.hasNext()) {
      IStatement action=it.next();
      if (action.minParameters() > gate.material.numActionParameters) {
        it.remove();
      }
    }
  }
  if (gateCallback != null) {
    gateCallback.setGate(gate);
  }
}
Program: 156817
Project: 156817
Buggy source:
public static BitSet fromByteArray(byte[] bytes){
  BitSet bits=new BitSet(bytes.length * 8);
  for (int i=0; i < bytes.length * 8; i++) {
    if ((bytes[bytes.length - (i >> 3) - 1] & (1 << (i & 7))) > 0) {
      bits.set(i);
    }
  }
  return bits;
}

Fixed version (ground truth):
public static BitSet fromByteArray(byte[] bytes){
  BitSet bits=new BitSet(bytes.length * 8);
  for (int i=0; i < bytes.length * 8; i++) {
    if ((bytes[i / 8] & (1 << (i % 8))) != 0) {
      bits.set(i);
    }
  }
  return bits;
}
Program: 156818
Project: 156818
Buggy source:
public static byte[] toByteArray(BitSet bits){
  byte[] bytes=new byte[(bits.length() + 7) >> 3];
  System.out.println(bits.length() + "String_Node_Str" + bytes.length);
  for (int i=0; i < bits.length(); i++) {
    if (bits.get(i)) {
      bytes[bytes.length - (i >> 3) - 1]|=1 << (i & 7);
    }
  }
  return bytes;
}

Fixed version (ground truth):
public static byte[] toByteArray(BitSet bits,int sizeInBytes){
  byte[] bytes=new byte[sizeInBytes];
  for (int i=0; i < bits.length(); i++) {
    if (bits.get(i)) {
      bytes[i / 8]|=1 << (i % 8);
    }
  }
  return bytes;
}
Program: 156819
Project: 156819
Buggy source:
@Override public void writeData(ByteBuf data){
  super.writeData(data);
  byte[] dBytes=BitSetUtils.toByteArray(delta);
  data.writeBytes(dBytes);
  for (  ForgeDirection dir : ForgeDirection.values()) {
    FluidStack liquid=renderCache[dir.ordinal()];
    if (delta.get(dir.ordinal() * FLUID_DATA_NUM + FLUID_ID_BIT)) {
      if (liquid != null) {
        data.writeShort(liquid.fluidID);
        data.writeInt(colorRenderCache[dir.ordinal()]);
      }
 else {
        data.writeShort(0);
        data.writeInt(0xFFFFFF);
      }
    }
    if (delta.get(dir.ordinal() * FLUID_DATA_NUM + FLUID_AMOUNT_BIT)) {
      if (liquid != null) {
        data.writeInt(liquid.amount);
      }
 else {
        data.writeInt(0);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void writeData(ByteBuf data){
  super.writeData(data);
  byte[] dBytes=BitSetUtils.toByteArray(delta,2);
  data.writeBytes(dBytes);
  for (  ForgeDirection dir : ForgeDirection.values()) {
    FluidStack liquid=renderCache[dir.ordinal()];
    if (delta.get(dir.ordinal() * FLUID_DATA_NUM + FLUID_ID_BIT)) {
      if (liquid != null) {
        data.writeShort(liquid.fluidID);
        data.writeInt(colorRenderCache[dir.ordinal()]);
      }
 else {
        data.writeShort(0);
        data.writeInt(0xFFFFFF);
      }
    }
    if (delta.get(dir.ordinal() * FLUID_DATA_NUM + FLUID_AMOUNT_BIT)) {
      if (liquid != null) {
        data.writeInt(liquid.amount);
      }
 else {
        data.writeInt(0);
      }
    }
  }
}
Program: 156821
Project: 156821
Buggy source:
@Override public boolean isTriggerActive(TileEntity tile,ForgeDirection side,IStatementContainer statementContainer,IStatementParameter[] parameters){
  if (tile instanceof IFluidHandler) {
    IFluidHandler container=(IFluidHandler)tile;
    FluidStack searchedFluid=null;
    if (parameters != null && parameters.length >= 1 && parameters[0].getItemStack() != null) {
      searchedFluid=FluidContainerRegistry.getFluidForFilledItem(parameters[0].getItemStack());
    }
    if (searchedFluid != null) {
      searchedFluid.amount=1;
    }
    FluidTankInfo[] liquids=container.getTankInfo(side);
    if (liquids == null || liquids.length == 0) {
      return false;
    }
    for (    FluidTankInfo c : liquids) {
      if (c.fluid == null) {
        if (searchedFluid == null) {
          return true;
        }
        return container.fill(side,searchedFluid,false) > 0;
      }
      if (searchedFluid == null || searchedFluid.isFluidEqual(c.fluid)) {
        float percentage=(float)c.fluid.amount / (float)c.capacity;
        return percentage < type.level;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isTriggerActive(TileEntity tile,ForgeDirection side,IStatementContainer statementContainer,IStatementParameter[] parameters){
  if (tile instanceof IFluidHandler) {
    IFluidHandler container=(IFluidHandler)tile;
    FluidStack searchedFluid=null;
    if (parameters != null && parameters.length >= 1 && parameters[0] != null && parameters[0].getItemStack() != null) {
      searchedFluid=FluidContainerRegistry.getFluidForFilledItem(parameters[0].getItemStack());
    }
    if (searchedFluid != null) {
      searchedFluid.amount=1;
    }
    FluidTankInfo[] liquids=container.getTankInfo(side);
    if (liquids == null || liquids.length == 0) {
      return false;
    }
    for (    FluidTankInfo c : liquids) {
      if (c.fluid == null) {
        if (searchedFluid == null) {
          return true;
        }
        return container.fill(side,searchedFluid,false) > 0;
      }
      if (searchedFluid == null || searchedFluid.isFluidEqual(c.fluid)) {
        float percentage=(float)c.fluid.amount / (float)c.capacity;
        return percentage < type.level;
      }
    }
  }
  return false;
}
Program: 156822
Project: 156822
Buggy source:
@Override public boolean isTriggerActive(TileEntity tile,ForgeDirection side,IStatementContainer container,IStatementParameter[] parameters){
  ItemStack searchedStack=null;
  if (parameters != null && parameters.length >= 1) {
    searchedStack=parameters[0].getItemStack();
  }
  if (tile instanceof IInventory) {
    boolean hasSlots=false;
    boolean foundItems=false;
    boolean foundSpace=false;
    for (    IInvSlot slot : InventoryIterator.getIterable((IInventory)tile,side.getOpposite())) {
      hasSlots=true;
      ItemStack stack=slot.getStackInSlot();
      foundItems|=stack != null && (searchedStack == null || StackHelper.canStacksOrListsMerge(stack,searchedStack));
      foundSpace|=(stack == null || (StackHelper.canStacksOrListsMerge(stack,searchedStack) && stack.stackSize < stack.getMaxStackSize())) && (searchedStack == null || searchedStack.getItem() instanceof ItemList || slot.canPutStackInSlot(searchedStack));
    }
    if (!hasSlots) {
      return false;
    }
switch (state) {
case Empty:
      return !foundItems;
case Contains:
    return foundItems;
case Space:
  return foundSpace;
default :
return !foundSpace;
}
}
return false;
}

Fixed version (ground truth):
@Override public boolean isTriggerActive(TileEntity tile,ForgeDirection side,IStatementContainer container,IStatementParameter[] parameters){
  ItemStack searchedStack=null;
  if (parameters != null && parameters.length >= 1 && parameters[0] != null) {
    searchedStack=parameters[0].getItemStack();
  }
  if (tile instanceof IInventory) {
    boolean hasSlots=false;
    boolean foundItems=false;
    boolean foundSpace=false;
    for (    IInvSlot slot : InventoryIterator.getIterable((IInventory)tile,side.getOpposite())) {
      hasSlots=true;
      ItemStack stack=slot.getStackInSlot();
      foundItems|=stack != null && (searchedStack == null || StackHelper.canStacksOrListsMerge(stack,searchedStack));
      foundSpace|=(stack == null || (StackHelper.canStacksOrListsMerge(stack,searchedStack) && stack.stackSize < stack.getMaxStackSize())) && (searchedStack == null || searchedStack.getItem() instanceof ItemList || slot.canPutStackInSlot(searchedStack));
    }
    if (!hasSlots) {
      return false;
    }
switch (state) {
case Empty:
      return !foundItems;
case Contains:
    return foundItems;
case Space:
  return foundSpace;
default :
return !foundSpace;
}
}
return false;
}
Program: 156823
Project: 156823
Buggy source:
@Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack,EntityPlayer player,List list,boolean advanced){
  super.addInformation(stack,player,list,advanced);
  Class<? extends Pipe> pipe=BlockGenericPipe.pipes.get(this);
  List<String> toolTip=PipeToolTipManager.getToolTip(pipe);
  list.addAll(toolTip);
}

Fixed version (ground truth):
@Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack,EntityPlayer player,List list,boolean advanced){
  super.addInformation(stack,player,list,advanced);
  if (stack.getItemDamage() >= 1) {
    list.add(EnumChatFormatting.WHITE + "String_Node_Str" + EnumChatFormatting.ITALIC+ StringUtils.capitalize(ColorUtils.WOOL_TO_NAME[(stack.getItemDamage() - 1) & 15].replace('.',' ')));
  }
  Class<? extends Pipe> pipe=BlockGenericPipe.pipes.get(this);
  List<String> toolTip=PipeToolTipManager.getToolTip(pipe);
  list.addAll(toolTip);
}
Program: 156824
Project: 156824
Buggy source:
public void initialize(Pipe<?> pipe){
  this.blockType=getBlockType();
  if (pipe == null) {
    BCLog.logger.log(Level.WARN,"String_Node_Str",new Object[]{xCoord,yCoord,zCoord});
    worldObj.setBlockToAir(xCoord,yCoord,zCoord);
    return;
  }
  this.pipe=pipe;
  for (  ForgeDirection o : ForgeDirection.VALID_DIRECTIONS) {
    TileEntity tile=getTile(o);
    if (tile instanceof ITileBufferHolder) {
      ((ITileBufferHolder)tile).blockCreated(o,BuildCraftTransport.genericPipeBlock,this);
    }
    if (tile instanceof TileGenericPipe) {
      ((TileGenericPipe)tile).scheduleNeighborChange();
    }
  }
  bindPipe();
  computeConnections();
  scheduleRenderUpdate();
  if (pipe.needsInit()) {
    pipe.initialize();
  }
  initialized=true;
}

Fixed version (ground truth):
public void initialize(Pipe<?> pipe){
  this.blockType=getBlockType();
  if (pipe == null) {
    BCLog.logger.log(Level.WARN,"String_Node_Str",new Object[]{xCoord,yCoord,zCoord});
    worldObj.setBlockToAir(xCoord,yCoord,zCoord);
    return;
  }
  this.pipe=pipe;
  for (  ForgeDirection o : ForgeDirection.VALID_DIRECTIONS) {
    TileEntity tile=getTile(o);
    if (tile instanceof ITileBufferHolder) {
      ((ITileBufferHolder)tile).blockCreated(o,BuildCraftTransport.genericPipeBlock,this);
    }
    if (tile instanceof TileGenericPipe) {
      ((TileGenericPipe)tile).scheduleNeighborChange();
    }
  }
  bindPipe();
  computeConnections();
  scheduleNeighborChange();
  scheduleRenderUpdate();
  if (pipe.needsInit()) {
    pipe.initialize();
  }
  initialized=true;
}
Program: 156825
Project: 156825
Buggy source:
@Override public void onNeighborBlockChange(World world,int x,int y,int z,Block block){
  TileEntity tile=world.getTileEntity(x,y,z);
  if (tile instanceof TileEngine) {
    ((TileEngine)tile).checkRedstonePower();
  }
}

Fixed version (ground truth):
@Override public void onNeighborBlockChange(World world,int x,int y,int z,Block block){
  TileEntity tile=world.getTileEntity(x,y,z);
  if (tile instanceof TileEngine) {
    ((TileEngine)tile).onNeighborUpdate();
  }
}
Program: 156826
Project: 156826
Buggy source:
@Override public void updateEntity(){
  super.updateEntity();
  if (worldObj.isRemote) {
    if (progressPart != 0) {
      progress+=getPistonSpeed();
      if (progress > 1) {
        progressPart=0;
        progress=0;
      }
    }
 else     if (this.isPumping) {
      progressPart=1;
    }
    return;
  }
  if (checkOrienation) {
    checkOrienation=false;
    if (!isOrientationValid()) {
      switchOrientation(true);
    }
 else {
      TileEntity tile=getTileBuffer(orientation).getTile();
      if (isPoweredTile(tile,orientation)) {
        if ((tile instanceof IPipeTile) && (((IPipeTile)tile).getPipeType() != PipeType.POWER)) {
          constantPower=false;
        }
 else {
          constantPower=true;
        }
      }
    }
  }
  updateHeatLevel();
  getEnergyStage();
  engineUpdate();
  TileEntity tile=getTileBuffer(orientation).getTile();
  if (progressPart != 0) {
    progress+=getPistonSpeed();
    if (progress > 0.5 && progressPart == 1) {
      progressPart=2;
      if (!constantPower) {
        sendPower();
      }
    }
 else     if (progress >= 1) {
      progress=0;
      progressPart=0;
    }
  }
 else   if (isRedstonePowered && isActive()) {
    if (isPoweredTile(tile,orientation)) {
      progressPart=1;
      setPumping(true);
      if (getPowerToExtract() > 0) {
        progressPart=1;
        setPumping(true);
      }
 else {
        setPumping(false);
      }
    }
 else {
      setPumping(false);
    }
  }
 else {
    setPumping(false);
  }
  burn();
  if (!isRedstonePowered) {
    currentOutput=0;
  }
 else   if (constantPower && isRedstonePowered && isActive()) {
    sendPower();
  }
}

Fixed version (ground truth):
@Override public void updateEntity(){
  super.updateEntity();
  if (worldObj.isRemote) {
    if (progressPart != 0) {
      progress+=getPistonSpeed();
      if (progress > 1) {
        progressPart=0;
        progress=0;
      }
    }
 else     if (this.isPumping) {
      progressPart=1;
    }
    return;
  }
  if (checkOrientation) {
    checkOrientation=false;
    if (!isOrientationValid()) {
      switchOrientation(true);
    }
 else {
      TileEntity tile=getTileBuffer(orientation).getTile();
      refreshPowerMode(tile,orientation);
    }
  }
  updateHeatLevel();
  getEnergyStage();
  engineUpdate();
  TileEntity tile=getTileBuffer(orientation).getTile();
  if (progressPart != 0) {
    progress+=getPistonSpeed();
    if (progress > 0.5 && progressPart == 1) {
      progressPart=2;
      if (!constantPower) {
        sendPower();
      }
    }
 else     if (progress >= 1) {
      progress=0;
      progressPart=0;
    }
  }
 else   if (isRedstonePowered && isActive()) {
    if (isPoweredTile(tile,orientation)) {
      progressPart=1;
      setPumping(true);
      if (getPowerToExtract() > 0) {
        progressPart=1;
        setPumping(true);
      }
 else {
        setPumping(false);
      }
    }
 else {
      setPumping(false);
    }
  }
 else {
    setPumping(false);
  }
  burn();
  if (!isRedstonePowered) {
    currentOutput=0;
  }
 else   if (constantPower && isRedstonePowered && isActive()) {
    sendPower();
  }
}
Program: 156827
Project: 156827
Buggy source:
private boolean switchOrientationDo(boolean pipesOnly){
  for (int i=orientation.ordinal() + 1; i <= orientation.ordinal() + 6; ++i) {
    ForgeDirection o=ForgeDirection.VALID_DIRECTIONS[i % 6];
    TileEntity tile=getTileBuffer(o).getTile();
    if ((!pipesOnly || tile instanceof IPipeTile) && isPoweredTile(tile,o)) {
      if ((tile instanceof IPipeTile) && (((IPipeTile)tile).getPipeType() != PipeType.POWER)) {
        constantPower=false;
      }
 else {
        constantPower=true;
      }
      orientation=o;
      worldObj.markBlockForUpdate(xCoord,yCoord,zCoord);
      worldObj.notifyBlocksOfNeighborChange(xCoord,yCoord,zCoord,worldObj.getBlock(xCoord,yCoord,zCoord));
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean switchOrientationDo(boolean pipesOnly){
  for (int i=orientation.ordinal() + 1; i <= orientation.ordinal() + 6; ++i) {
    ForgeDirection o=ForgeDirection.VALID_DIRECTIONS[i % 6];
    TileEntity tile=getTileBuffer(o).getTile();
    if ((!pipesOnly || tile instanceof IPipeTile) && isPoweredTile(tile,o)) {
      refreshPowerMode(tile,o);
      orientation=o;
      worldObj.markBlockForUpdate(xCoord,yCoord,zCoord);
      worldObj.notifyBlocksOfNeighborChange(xCoord,yCoord,zCoord,worldObj.getBlock(xCoord,yCoord,zCoord));
      return true;
    }
  }
  return false;
}
Program: 156828
Project: 156828
Buggy source:
@Override public void validate(){
  super.validate();
  tileCache=null;
  checkOrienation=true;
}

Fixed version (ground truth):
@Override public void validate(){
  super.validate();
  tileCache=null;
  checkOrientation=true;
}
Program: 156829
Project: 156829
Buggy source:
@Override public void invalidate(){
  super.invalidate();
  tileCache=null;
  checkOrienation=true;
}

Fixed version (ground truth):
@Override public void invalidate(){
  super.invalidate();
  tileCache=null;
  checkOrientation=true;
}
Program: 156831
Project: 156831
Buggy source:
private boolean writePrimitive(ByteBuf data,Class<?> formal,Object actual){
  if (int.class.equals(formal)) {
    data.writeInt((Integer)actual);
  }
 else   if (float.class.equals(formal)) {
    data.writeFloat((Float)actual);
  }
 else   if (double.class.equals(formal)) {
    data.writeDouble((Double)actual);
  }
 else   if (char.class.equals(formal)) {
    data.writeChar((Character)actual);
  }
 else   if (boolean.class.equals(formal)) {
    data.writeBoolean((Boolean)actual);
  }
 else   if (String.class.equals(formal)) {
    Utils.writeUTF(data,(String)actual);
  }
 else   if (Enum.class.isAssignableFrom(formal)) {
    data.writeByte((byte)((Enum)(actual)).ordinal());
  }
 else {
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean writePrimitive(ByteBuf data,Class<?> formal,Object actual){
  if (int.class.equals(formal)) {
    data.writeInt((Integer)actual);
  }
 else   if (float.class.equals(formal)) {
    data.writeFloat((Float)actual);
  }
 else   if (double.class.equals(formal)) {
    data.writeDouble((Double)actual);
  }
 else   if (char.class.equals(formal)) {
    data.writeChar((Character)actual);
  }
 else   if (boolean.class.equals(formal)) {
    data.writeBoolean((Boolean)actual);
  }
 else   if (String.class.equals(formal)) {
    Utils.writeUTF(data,(String)actual);
  }
 else   if (Enum.class.isAssignableFrom(formal)) {
    data.writeByte((byte)((Enum)actual).ordinal());
  }
 else {
    return false;
  }
  return true;
}
Program: 156832
Project: 156832
Buggy source:
@Override public void renderParticle(Tessellator p_70539_1_,float p_70539_2_,float p_70539_3_,float p_70539_4_,float p_70539_5_,float p_70539_6_,float p_70539_7_){
  float f6=(this.particleAge + p_70539_2_) / this.particleMaxAge * 32.0F;
  if (f6 < 0.0F) {
    f6=0.0F;
  }
  if (f6 > 1.0F) {
    f6=1.0F;
  }
  this.particleScale=this.smokeParticleScale * f6;
  super.renderParticle(p_70539_1_,p_70539_2_,p_70539_3_,p_70539_4_,p_70539_5_,p_70539_6_,p_70539_7_);
}

Fixed version (ground truth):
@Override public void renderParticle(Tessellator tesslator,float p2,float p3,float p4,float p5,float p6,float p7){
  float f6=(this.particleAge + p2) / this.particleMaxAge * 32.0F;
  if (f6 < 0.0F) {
    f6=0.0F;
  }
  if (f6 > 1.0F) {
    f6=1.0F;
  }
  this.particleScale=this.smokeParticleScale * f6;
  super.renderParticle(tesslator,p2,p3,p4,p5,p6,p7);
}
Program: 156833
Project: 156833
Buggy source:
@Override public void dock(IDockingStation station){
  currentDockingStation=(DockingStation)station;
  setSteamDirection(currentDockingStation.side.offsetX,currentDockingStation.side.offsetY,currentDockingStation.side.offsetZ);
}

Fixed version (ground truth):
@Override public void dock(IDockingStation station){
  currentDockingStation=(DockingStation)station;
  setSteamDirection(currentDockingStation.side.offsetX,currentDockingStation.side.offsetY,currentDockingStation.side.offsetZ);
  currentDockingStationIndex=currentDockingStation.index();
  currentDockingStationSide=currentDockingStation.side();
}
Program: 156834
Project: 156834
Buggy source:
public void setMainStation(IDockingStation iStation){
  DockingStation station=(DockingStation)iStation;
  if (linkedDockingStation != null && linkedDockingStation != station) {
    ((DockingStation)linkedDockingStation).release(this);
  }
  linkedDockingStation=station;
}

Fixed version (ground truth):
public void setMainStation(IDockingStation iStation){
  DockingStation station=(DockingStation)iStation;
  if (linkedDockingStation != null && linkedDockingStation != station) {
    ((DockingStation)linkedDockingStation).release(this);
  }
  linkedDockingStation=station;
  linkedDockingStationIndex=linkedDockingStation.index();
  linkedDockingStationSide=linkedDockingStation.side();
}
Program: 156835
Project: 156835
Buggy source:
@Override public void undock(){
  if (currentDockingStation != null) {
    currentDockingStation.release(this);
    currentDockingStation=null;
    setSteamDirection(0,-1,0);
  }
}

Fixed version (ground truth):
@Override public void undock(){
  if (currentDockingStation != null) {
    currentDockingStation.release(this);
    currentDockingStation=null;
    setSteamDirection(0,-1,0);
    currentDockingStationIndex=null;
    currentDockingStationSide=null;
  }
}
Program: 156838
Project: 156838
Buggy source:
@Override public void delegateAIEnded(AIRobot ai){
  if (ai instanceof AIRobotSearchStackRequest) {
    if (!ai.success()) {
      deliveryBlacklist.clear();
      startDelegateAI(new AIRobotGotoSleep(robot));
    }
 else {
      currentRequest=((AIRobotSearchStackRequest)ai).request;
      if (!currentRequest.station.take(robot)) {
        currentRequest=null;
      }
    }
  }
 else   if (ai instanceof AIRobotGotoStationAndLoad) {
    if (!ai.success()) {
      deliveryBlacklist.add(currentRequest.stack);
      robot.releaseResources();
      currentRequest=null;
    }
 else {
      startDelegateAI(new AIRobotDeliverRequested(robot,currentRequest));
    }
  }
 else   if (ai instanceof AIRobotDeliverRequested) {
    robot.releaseResources();
  }
}

Fixed version (ground truth):
@Override public void delegateAIEnded(AIRobot ai){
  if (ai instanceof AIRobotSearchStackRequest) {
    if (!ai.success()) {
      deliveryBlacklist.clear();
      startDelegateAI(new AIRobotGotoSleep(robot));
    }
 else {
      currentRequest=((AIRobotSearchStackRequest)ai).request;
      if (!currentRequest.station.take(robot)) {
        currentRequest=null;
      }
    }
  }
 else   if (ai instanceof AIRobotGotoStationAndLoad) {
    if (!ai.success()) {
      deliveryBlacklist.add(currentRequest.stack);
      robot.releaseResources();
      currentRequest=null;
    }
 else {
      startDelegateAI(new AIRobotDeliverRequested(robot,currentRequest));
    }
  }
 else   if (ai instanceof AIRobotDeliverRequested) {
    robot.releaseResources();
    currentRequest=null;
  }
}
Program: 156839
Project: 156839
Buggy source:
private IIcon tryGetBlockIcon(Block block,int side,int decodedMeta){
  try {
    IIcon icon=block.getIcon(side,decodedMeta);
    if (icon != null) {
      return icon;
    }
 else {
      return Blocks.cobblestone.getIcon(0,0);
    }
  }
 catch (  Throwable t) {
    try {
      return block.getBlockTextureFromSide(side);
    }
 catch (    Throwable t2) {
      return PipeIconProvider.TYPE.TransparentFacade.getIcon();
    }
  }
}

Fixed version (ground truth):
private IIcon tryGetBlockIcon(Block block,int side,int decodedMeta){
  try {
    IIcon icon=block.getIcon(side,decodedMeta);
    if (icon != null) {
      return icon;
    }
 else {
      return PipeIconProvider.TYPE.TransparentFacade.getIcon();
    }
  }
 catch (  Throwable t) {
    try {
      return block.getBlockTextureFromSide(side);
    }
 catch (    Throwable t2) {
      return PipeIconProvider.TYPE.TransparentFacade.getIcon();
    }
  }
}
Program: 156840
Project: 156840
Buggy source:
@Override public void update(){
  blockDamage+=speed / hardness / 30F;
  if (blockDamage > 1.0F) {
    robot.worldObj.destroyBlockInWorldPartially(robot.getEntityId(),blockToBreak.x,blockToBreak.y,blockToBreak.z,-1);
    blockDamage=0;
    if (robot.getHeldItem() != null) {
      robot.getHeldItem().getItem().onBlockStartBreak(robot.getHeldItem(),blockToBreak.x,blockToBreak.y,blockToBreak.z,CoreProxy.proxy.getBuildCraftPlayer((WorldServer)robot.worldObj).get());
    }
    BlockUtil.breakBlock((WorldServer)robot.worldObj,blockToBreak.x,blockToBreak.y,blockToBreak.z,6000);
    robot.worldObj.playAuxSFXAtEntity(null,2001,blockToBreak.x,blockToBreak.y,blockToBreak.z,Block.getIdFromBlock(block) + (meta << 12));
    if (robot.getHeldItem() != null) {
      robot.getHeldItem().getItem().onBlockDestroyed(robot.getHeldItem(),robot.worldObj,block,blockToBreak.x,blockToBreak.y,blockToBreak.z,robot);
      if (robot.getHeldItem().getItemDamage() >= robot.getHeldItem().getMaxDamage()) {
        robot.setItemInUse(null);
      }
    }
    terminate();
  }
 else {
    robot.worldObj.destroyBlockInWorldPartially(robot.getEntityId(),blockToBreak.x,blockToBreak.y,blockToBreak.z,(int)(blockDamage * 10.0F) - 1);
  }
}

Fixed version (ground truth):
@Override public void update(){
  if (hardness == 0) {
    terminate();
    return;
  }
  blockDamage+=speed / hardness / 30F;
  if (blockDamage > 1.0F) {
    robot.worldObj.destroyBlockInWorldPartially(robot.getEntityId(),blockToBreak.x,blockToBreak.y,blockToBreak.z,-1);
    blockDamage=0;
    if (robot.getHeldItem() != null) {
      robot.getHeldItem().getItem().onBlockStartBreak(robot.getHeldItem(),blockToBreak.x,blockToBreak.y,blockToBreak.z,CoreProxy.proxy.getBuildCraftPlayer((WorldServer)robot.worldObj).get());
    }
    BlockUtil.breakBlock((WorldServer)robot.worldObj,blockToBreak.x,blockToBreak.y,blockToBreak.z,6000);
    robot.worldObj.playAuxSFXAtEntity(null,2001,blockToBreak.x,blockToBreak.y,blockToBreak.z,Block.getIdFromBlock(block) + (meta << 12));
    if (robot.getHeldItem() != null) {
      robot.getHeldItem().getItem().onBlockDestroyed(robot.getHeldItem(),robot.worldObj,block,blockToBreak.x,blockToBreak.y,blockToBreak.z,robot);
      if (robot.getHeldItem().getItemDamage() >= robot.getHeldItem().getMaxDamage()) {
        robot.setItemInUse(null);
      }
    }
    terminate();
  }
 else {
    robot.worldObj.destroyBlockInWorldPartially(robot.getEntityId(),blockToBreak.x,blockToBreak.y,blockToBreak.z,(int)(blockDamage * 10.0F) - 1);
  }
}
Program: 156841
Project: 156841
Buggy source:
@Override protected void entityInit(){
  super.entityInit();
  setNullBoundingBox();
  preventEntitySpawning=false;
  noClip=true;
  isImmuneToFire=true;
  dataWatcher.addObject(12,Float.valueOf(0));
  dataWatcher.addObject(13,Float.valueOf(0));
  dataWatcher.addObject(14,Float.valueOf(0));
  dataWatcher.addObject(15,Byte.valueOf((byte)0));
  dataWatcher.addObject(16,"String_Node_Str");
  dataWatcher.addObject(17,Float.valueOf(0));
  dataWatcher.addObject(18,Float.valueOf(0));
}

Fixed version (ground truth):
@Override protected void entityInit(){
  super.entityInit();
  setNullBoundingBox();
  preventEntitySpawning=false;
  noClip=true;
  isImmuneToFire=true;
  dataWatcher.addObject(12,Float.valueOf(0));
  dataWatcher.addObject(13,Float.valueOf(0));
  dataWatcher.addObject(14,Float.valueOf(0));
  dataWatcher.addObject(15,Byte.valueOf((byte)0));
  dataWatcher.addObject(16,"String_Node_Str");
  dataWatcher.addObject(17,Float.valueOf(0));
  dataWatcher.addObject(18,Float.valueOf(0));
  dataWatcher.addObject(19,Float.valueOf(0));
}
Program: 156843
Project: 156843
Buggy source:
protected void updateDataClient(){
  laser.tail.x=dataWatcher.getWatchableObjectFloat(12);
  laser.tail.y=dataWatcher.getWatchableObjectFloat(13);
  laser.tail.z=dataWatcher.getWatchableObjectFloat(14);
  laser.isVisible=dataWatcher.getWatchableObjectByte(15) == 1;
  RedstoneBoardNBT<?> boardNBT=RedstoneBoardRegistry.instance.getRedstoneBoard(dataWatcher.getWatchableObjectString(16));
  if (boardNBT != null) {
    texture=((RedstoneBoardRobotNBT)boardNBT).getRobotTexture();
  }
  itemAngle1=dataWatcher.getWatchableObjectFloat(17);
  itemAngle2=dataWatcher.getWatchableObjectFloat(18);
}

Fixed version (ground truth):
protected void updateDataClient(){
  laser.tail.x=dataWatcher.getWatchableObjectFloat(12);
  laser.tail.y=dataWatcher.getWatchableObjectFloat(13);
  laser.tail.z=dataWatcher.getWatchableObjectFloat(14);
  laser.isVisible=dataWatcher.getWatchableObjectByte(15) == 1;
  RedstoneBoardNBT<?> boardNBT=RedstoneBoardRegistry.instance.getRedstoneBoard(dataWatcher.getWatchableObjectString(16));
  if (boardNBT != null) {
    texture=((RedstoneBoardRobotNBT)boardNBT).getRobotTexture();
  }
  itemAngle1=dataWatcher.getWatchableObjectFloat(17);
  itemAngle2=dataWatcher.getWatchableObjectFloat(18);
  energySpendPerCycle=dataWatcher.getWatchableObjectFloat(19);
}
Program: 156844
Project: 156844
Buggy source:
protected void updateDataServer(){
  dataWatcher.updateObject(12,Float.valueOf((float)laser.tail.x));
  dataWatcher.updateObject(13,Float.valueOf((float)laser.tail.y));
  dataWatcher.updateObject(14,Float.valueOf((float)laser.tail.z));
  dataWatcher.updateObject(15,Byte.valueOf((byte)(laser.isVisible ? 1 : 0)));
  dataWatcher.updateObject(17,Float.valueOf(itemAngle1));
  dataWatcher.updateObject(18,Float.valueOf(itemAngle2));
}

Fixed version (ground truth):
protected void updateDataServer(){
  dataWatcher.updateObject(12,Float.valueOf((float)laser.tail.x));
  dataWatcher.updateObject(13,Float.valueOf((float)laser.tail.y));
  dataWatcher.updateObject(14,Float.valueOf((float)laser.tail.z));
  dataWatcher.updateObject(15,Byte.valueOf((byte)(laser.isVisible ? 1 : 0)));
  dataWatcher.updateObject(17,Float.valueOf(itemAngle1));
  dataWatcher.updateObject(18,Float.valueOf(itemAngle2));
  dataWatcher.updateObject(19,energySpendPerCycle);
}
Program: 156845
Project: 156845
Buggy source:
@Override public void update(){
  if (robot.getHeldItem() == null) {
    startDelegateAI(new AIRobotFetchAndEquipItemStack(robot,new IStackFilter(){
      @Override public boolean matches(      ItemStack stack){
        return stack != null && stack.getItem() instanceof ItemHoe;
      }
    }
));
  }
 else {
    startDelegateAI(new AIRobotSearchBlock(robot,new IBlockFilter(){
      @Override public boolean matches(      World world,      int x,      int y,      int z){
        return BuildCraftAPI.isDirtProperty.get(world,x,y,z) && robot.getRegistry().isTaken(new ResourceIdBlock(x,y,z)) && isAirAbove(world,x,y,z);
      }
    }
));
  }
}

Fixed version (ground truth):
@Override public void update(){
  if (robot.getHeldItem() == null) {
    startDelegateAI(new AIRobotFetchAndEquipItemStack(robot,new IStackFilter(){
      @Override public boolean matches(      ItemStack stack){
        return stack != null && stack.getItem() instanceof ItemHoe;
      }
    }
));
  }
 else {
    startDelegateAI(new AIRobotSearchBlock(robot,new IBlockFilter(){
      @Override public boolean matches(      World world,      int x,      int y,      int z){
        return BuildCraftAPI.isDirtProperty.get(world,x,y,z) && !robot.getRegistry().isTaken(new ResourceIdBlock(x,y,z)) && isAirAbove(world,x,y,z);
      }
    }
));
  }
}
Program: 156846
Project: 156846
Buggy source:
@Override public boolean matches(World world,int x,int y,int z){
  return BuildCraftAPI.isDirtProperty.get(world,x,y,z) && robot.getRegistry().isTaken(new ResourceIdBlock(x,y,z)) && isAirAbove(world,x,y,z);
}

Fixed version (ground truth):
@Override public boolean matches(World world,int x,int y,int z){
  return BuildCraftAPI.isDirtProperty.get(world,x,y,z) && !robot.getRegistry().isTaken(new ResourceIdBlock(x,y,z)) && isAirAbove(world,x,y,z);
}
Program: 156847
Project: 156847
Buggy source:
@Override public final void update(){
  if (!isExpectedTool(null) && robot.getHeldItem() == null) {
    startDelegateAI(new AIRobotFetchAndEquipItemStack(robot,new IStackFilter(){
      @Override public boolean matches(      ItemStack stack){
        return isExpectedTool(stack);
      }
    }
));
  }
 else {
    startDelegateAI(new AIRobotSearchBlock(robot,new IBlockFilter(){
      @Override public boolean matches(      World world,      int x,      int y,      int z){
        if (isExpectedBlock(world,x,y,z) && matchesGateFilter(world,x,y,z)) {
          return robot.getRegistry().isTaken(new ResourceIdBlock(x,y,z));
        }
 else {
          return false;
        }
      }
    }
));
  }
}

Fixed version (ground truth):
@Override public final void update(){
  if (!isExpectedTool(null) && robot.getHeldItem() == null) {
    startDelegateAI(new AIRobotFetchAndEquipItemStack(robot,new IStackFilter(){
      @Override public boolean matches(      ItemStack stack){
        return isExpectedTool(stack);
      }
    }
));
  }
 else {
    startDelegateAI(new AIRobotSearchBlock(robot,new IBlockFilter(){
      @Override public boolean matches(      World world,      int x,      int y,      int z){
        if (isExpectedBlock(world,x,y,z) && matchesGateFilter(world,x,y,z)) {
          return !robot.getRegistry().isTaken(new ResourceIdBlock(x,y,z));
        }
 else {
          return false;
        }
      }
    }
));
  }
}
Program: 156848
Project: 156848
Buggy source:
@Override public boolean matches(World world,int x,int y,int z){
  if (isExpectedBlock(world,x,y,z) && matchesGateFilter(world,x,y,z)) {
    return robot.getRegistry().isTaken(new ResourceIdBlock(x,y,z));
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean matches(World world,int x,int y,int z){
  if (isExpectedBlock(world,x,y,z) && matchesGateFilter(world,x,y,z)) {
    return !robot.getRegistry().isTaken(new ResourceIdBlock(x,y,z));
  }
 else {
    return false;
  }
}