nus-yam/ex-repair huggingface dataset:
Program: 156703
Project: 156703
Buggy source:
@Override public List<BlockPos> getPath(ItemStack item){
  NBTTagCompound cpt=NBTUtils.getItemData(item);
  if (cpt.hasKey("String_Node_Str") && cpt.getByte("String_Node_Str") == 2) {
    List<BlockPos> indexList=new ArrayList<BlockPos>();
    NBTTagList pathNBT=cpt.getTagList("String_Node_Str",Constants.NBT.TAG_COMPOUND);
    for (int i=0; i < pathNBT.tagCount(); i++) {
      indexList.add(new BlockPos(pathNBT.getCompoundTagAt(i)));
    }
    return indexList;
  }
 else   if (cpt.hasKey("String_Node_Str") && cpt.getByte("String_Node_Str") == 0) {
    List<BlockPos> indexList=new ArrayList<BlockPos>();
    indexList.add(new BlockPos(cpt.getInteger("String_Node_Str"),cpt.getInteger("String_Node_Str"),cpt.getInteger("String_Node_Str")));
    return indexList;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Override public List<BlockPos> getPath(ItemStack item){
  NBTTagCompound cpt=NBTUtils.getItemData(item);
  if (cpt.hasKey("String_Node_Str") && cpt.getByte("String_Node_Str") == 2) {
    List<BlockPos> indexList=new ArrayList<BlockPos>();
    NBTTagList pathNBT=cpt.getTagList("String_Node_Str",Constants.NBT.TAG_COMPOUND);
    for (int i=0; i < pathNBT.tagCount(); i++) {
      indexList.add(NBTUtils.readBlockPos(pathNBT.getCompoundTagAt(i)));
    }
    return indexList;
  }
 else   if (cpt.hasKey("String_Node_Str") && cpt.getByte("String_Node_Str") == 0) {
    List<BlockPos> indexList=new ArrayList<BlockPos>();
    indexList.add(new BlockPos(cpt.getInteger("String_Node_Str"),cpt.getInteger("String_Node_Str"),cpt.getInteger("String_Node_Str")));
    return indexList;
  }
 else {
    return null;
  }
}
Program: 156704
Project: 156704
Buggy source:
@Override public EnumFacing getPointSide(ItemStack item){
  NBTTagCompound cpt=NBTUtils.getItemData(item);
  if (cpt.hasKey("String_Node_Str") && cpt.getByte("String_Node_Str") == 0) {
    return EnumFacing.values()[cpt.getByte("String_Node_Str")];
  }
 else {
    return EnumFacing.UNKNOWN;
  }
}

Fixed version (ground truth):
@Override public EnumFacing getPointSide(ItemStack item){
  NBTTagCompound cpt=NBTUtils.getItemData(item);
  if (cpt.hasKey("String_Node_Str") && cpt.getByte("String_Node_Str") == 0) {
    return EnumFacing.values()[cpt.getByte("String_Node_Str")];
  }
 else {
    return null;
  }
}
Program: 156705
Project: 156705
Buggy source:
@Override public boolean onItemUse(ItemStack stack,EntityPlayer par2EntityPlayer,World world,int x,int y,int z,int side,float par8,float par9,float par10){
  TileEntity tile=world.getTileEntity(x,y,z);
  NBTTagCompound cpt=NBTUtils.getItemData(stack);
  if (tile instanceof IPathProvider) {
    cpt.setByte("String_Node_Str",(byte)2);
    NBTTagList pathNBT=new NBTTagList();
    for (    BlockPos index : ((IPathProvider)tile).getPath()) {
      NBTTagCompound nbt=new NBTTagCompound();
      index.writeTo(nbt);
      pathNBT.appendTag(nbt);
    }
    cpt.setTag("String_Node_Str",pathNBT);
  }
 else   if (tile instanceof IAreaProvider) {
    cpt.setByte("String_Node_Str",(byte)1);
    IAreaProvider areaTile=(IAreaProvider)tile;
    cpt.setInteger("String_Node_Str",areaTile.xMin());
    cpt.setInteger("String_Node_Str",areaTile.yMin());
    cpt.setInteger("String_Node_Str",areaTile.zMin());
    cpt.setInteger("String_Node_Str",areaTile.xMax());
    cpt.setInteger("String_Node_Str",areaTile.yMax());
    cpt.setInteger("String_Node_Str",areaTile.zMax());
  }
 else {
    cpt.setByte("String_Node_Str",(byte)0);
    cpt.setByte("String_Node_Str",(byte)side);
    cpt.setInteger("String_Node_Str",x);
    cpt.setInteger("String_Node_Str",y);
    cpt.setInteger("String_Node_Str",z);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onItemUse(ItemStack stack,EntityPlayer par2EntityPlayer,World world,BlockPos pos,EnumFacing side,float par8,float par9,float par10){
  TileEntity tile=world.getTileEntity(pos);
  NBTTagCompound cpt=NBTUtils.getItemData(stack);
  if (tile instanceof IPathProvider) {
    cpt.setByte("String_Node_Str",(byte)2);
    NBTTagList pathNBT=new NBTTagList();
    for (    BlockPos index : ((IPathProvider)tile).getPath()) {
      pathNBT.appendTag(NBTUtils.writeBlockPos(index));
    }
    cpt.setTag("String_Node_Str",pathNBT);
  }
 else   if (tile instanceof IAreaProvider) {
    cpt.setByte("String_Node_Str",(byte)1);
    IAreaProvider areaTile=(IAreaProvider)tile;
    cpt.setInteger("String_Node_Str",areaTile.xMin());
    cpt.setInteger("String_Node_Str",areaTile.yMin());
    cpt.setInteger("String_Node_Str",areaTile.zMin());
    cpt.setInteger("String_Node_Str",areaTile.xMax());
    cpt.setInteger("String_Node_Str",areaTile.yMax());
    cpt.setInteger("String_Node_Str",areaTile.zMax());
  }
 else {
    cpt.setByte("String_Node_Str",(byte)0);
    cpt.setByte("String_Node_Str",(byte)side.getIndex());
    cpt.setInteger("String_Node_Str",pos.getX());
    cpt.setInteger("String_Node_Str",pos.getY());
    cpt.setInteger("String_Node_Str",pos.getZ());
  }
  return true;
}
Program: 156706
Project: 156706
Buggy source:
/** 
 * Deploy the contents of the byte array as if the builder was located at {x, y, z} facing the direction dir. 
 */
public abstract void deployBlueprintFromFileStream(World world,int x,int y,int z,EnumFacing dir,byte[] data);

Fixed version (ground truth):
/** 
 * Deploy the contents of the byte array as if the builder was located at {pos} facing the direction dir. 
 */
public abstract void deployBlueprintFromFileStream(World world,BlockPos pos,EnumFacing dir,byte[] data);
Program: 156707
Project: 156707
Buggy source:
/** 
 * Deploy the contents of the blueprints as if the builder was located at {x, y, z} facing the direction dir. 
 */
public abstract void deployBlueprint(World world,BlockPos pos,EnumFacing facing,File file);

Fixed version (ground truth):
/** 
 * Deploy the contents of the blueprints as if the builder was located at {pos} facing the direction dir. 
 */
public abstract void deployBlueprint(World world,BlockPos pos,EnumFacing facing,File file);
Program: 156708
Project: 156708
Buggy source:
void registerSchematicBlock(Block block,int meta,Class<? extends Schematic> clazz,Object... params);

Fixed version (ground truth):
void registerSchematicBlock(IBlockState state,Class<? extends Schematic> clazz,Object... params);
Program: 156709
Project: 156709
Buggy source:
boolean isSupported(Block block,int metadata);

Fixed version (ground truth):
boolean isSupported(IBlockState state);
Program: 156710
Project: 156710
Buggy source:
@SubscribeEvent @SideOnly(Side.CLIENT) public void textureHook(TextureStitchEvent.Pre event){
  if (event.map.getTextureType() == 0) {
    for (    Item i : BlockGenericPipe.pipes.keySet()) {
      Pipe<?> dummyPipe=BlockGenericPipe.createPipe(i);
      if (dummyPipe != null) {
        dummyPipe.getIconProvider().registerIcons(event.map);
      }
    }
    wireIconProvider.registerIcons(event.map);
    for (    GateDefinition.GateMaterial material : GateDefinition.GateMaterial.VALUES) {
      material.registerBlockIcon(event.map);
    }
    for (    GateDefinition.GateLogic logic : GateDefinition.GateLogic.VALUES) {
      logic.registerBlockIcon(event.map);
    }
    for (    IGateExpansion expansion : GateExpansions.getExpansions()) {
      expansion.registerBlockOverlay(event.map);
    }
  }
}

Fixed version (ground truth):
@SubscribeEvent @SideOnly(Side.CLIENT) public void textureHook(TextureStitchEvent.Pre event){
  if (event.map.getTextureType() == 0) {
    for (    Item i : BlockGenericPipe.pipes.keySet()) {
      Pipe<?> dummyPipe=BlockGenericPipe.createPipe(i);
      if (dummyPipe != null) {
        dummyPipe.getIconProvider().registerIcons(event.map);
      }
    }
    wireIconProvider.registerIcons(event.map);
    for (    GateDefinition.GateMaterial material : GateDefinition.GateMaterial.VALUES) {
      material.registerBlockIcon(event.map);
    }
    for (    GateDefinition.GateLogic logic : GateDefinition.GateLogic.VALUES) {
      logic.registerBlockIcon(event.map);
    }
    for (    IGateExpansion expansion : GateExpansions.getExpansions()) {
      expansion.registerBlockOverlay(event.map);
    }
    PipeRendererTESR.INSTANCE.onTextureReload();
  }
}
Program: 156711
Project: 156711
Buggy source:
@Override public void registerTileEntities(){
  super.registerTileEntities();
  PipeRendererTESR rp=new PipeRendererTESR();
  ClientRegistry.bindTileEntitySpecialRenderer(TileGenericPipe.class,rp);
}

Fixed version (ground truth):
@Override public void registerTileEntities(){
  super.registerTileEntities();
  ClientRegistry.bindTileEntitySpecialRenderer(TileGenericPipe.class,PipeRendererTESR.INSTANCE);
}
Program: 156712
Project: 156712
Buggy source:
public PipeRendererTESR(){
  customRenderItem=new RenderItem(){
    @Override public boolean shouldBob(){
      return false;
    }
    @Override public boolean shouldSpreadItems(){
      return false;
    }
  }
;
  customRenderItem.setRenderManager(RenderManager.instance);
}

Fixed version (ground truth):
private PipeRendererTESR(){
  customRenderItem=new RenderItem(){
    @Override public boolean shouldBob(){
      return false;
    }
    @Override public boolean shouldSpreadItems(){
      return false;
    }
  }
;
  customRenderItem.setRenderManager(RenderManager.instance);
}
Program: 156713
Project: 156713
Buggy source:
/** 
 * Relocates a stack nbt from the registry referential to the world referential.
 */
public void stackToWorld(NBTTagCompound nbt) throws MappingNotFoundException {
  Item item=getItemForId(nbt.getShort("String_Node_Str"));
  nbt.setShort("String_Node_Str",(short)Item.getIdFromItem(item));
}

Fixed version (ground truth):
/** 
 * Relocates a stack nbt from the registry referential to the world referential. 
 */
public void stackToWorld(NBTTagCompound nbt) throws MappingNotFoundException {
  Item item=getItemForId(nbt.getShort("String_Node_Str"));
  nbt.setShort("String_Node_Str",(short)Item.getIdFromItem(item));
}
Program: 156714
Project: 156714
Buggy source:
public void scanAndTranslateStacksToRegistry(NBTTagCompound nbt){
  if (isStackLayout(nbt)) {
    stackToRegistry(nbt);
  }
  for (  Object keyO : nbt.func_150296_c()) {
    String key=(String)keyO;
    if (nbt.getTag(key) instanceof NBTTagCompound) {
      scanAndTranslateStacksToRegistry(nbt.getCompoundTag(key));
    }
    if (nbt.getTag(key) instanceof NBTTagList) {
      NBTTagList list=(NBTTagList)nbt.getTag(key);
      if (list.func_150303_d() == Constants.NBT.TAG_COMPOUND) {
        for (int i=0; i < list.tagCount(); ++i) {
          scanAndTranslateStacksToRegistry(list.getCompoundTagAt(i));
        }
      }
    }
  }
}

Fixed version (ground truth):
public void scanAndTranslateStacksToRegistry(NBTTagCompound nbt){
  if (isStackLayout(nbt)) {
    stackToRegistry(nbt);
  }
  for (  Object keyO : nbt.getKeySet()) {
    String key=(String)keyO;
    if (nbt.getTag(key) instanceof NBTTagCompound) {
      scanAndTranslateStacksToRegistry(nbt.getCompoundTag(key));
    }
    if (nbt.getTag(key) instanceof NBTTagList) {
      NBTTagList list=(NBTTagList)nbt.getTag(key);
      if (list.getTagType() == Constants.NBT.TAG_COMPOUND) {
        for (int i=0; i < list.tagCount(); ++i) {
          scanAndTranslateStacksToRegistry(list.getCompoundTagAt(i));
        }
      }
    }
  }
}
Program: 156715
Project: 156715
Buggy source:
public void scanAndTranslateStacksToWorld(NBTTagCompound nbt) throws MappingNotFoundException {
  if (isStackLayout(nbt)) {
    stackToWorld(nbt);
  }
  for (  Object keyO : new HashSet(nbt.func_150296_c())) {
    String key=(String)keyO;
    if (nbt.getTag(key) instanceof NBTTagCompound) {
      try {
        scanAndTranslateStacksToWorld(nbt.getCompoundTag(key));
      }
 catch (      MappingNotFoundException e) {
        nbt.removeTag(key);
      }
    }
    if (nbt.getTag(key) instanceof NBTTagList) {
      NBTTagList list=(NBTTagList)nbt.getTag(key);
      if (list.func_150303_d() == Constants.NBT.TAG_COMPOUND) {
        for (int i=list.tagCount() - 1; i >= 0; --i) {
          try {
            scanAndTranslateStacksToWorld(list.getCompoundTagAt(i));
          }
 catch (          MappingNotFoundException e) {
            list.removeTag(i);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void scanAndTranslateStacksToWorld(NBTTagCompound nbt) throws MappingNotFoundException {
  if (isStackLayout(nbt)) {
    stackToWorld(nbt);
  }
  for (  Object keyO : new HashSet(nbt.getKeySet())) {
    String key=(String)keyO;
    if (nbt.getTag(key) instanceof NBTTagCompound) {
      try {
        scanAndTranslateStacksToWorld(nbt.getCompoundTag(key));
      }
 catch (      MappingNotFoundException e) {
        nbt.removeTag(key);
      }
    }
    if (nbt.getTag(key) instanceof NBTTagList) {
      NBTTagList list=(NBTTagList)nbt.getTag(key);
      if (list.getTagType() == Constants.NBT.TAG_COMPOUND) {
        for (int i=list.tagCount() - 1; i >= 0; --i) {
          try {
            scanAndTranslateStacksToWorld(list.getCompoundTagAt(i));
          }
 catch (          MappingNotFoundException e) {
            list.removeTag(i);
          }
        }
      }
    }
  }
}
Program: 156716
Project: 156716
Buggy source:
private Object getMissingMappingFromFML(boolean isBlock,String name,int i){
  String modName=name.split("String_Node_Str")[0];
  if (Loader.isModLoaded(modName)) {
    try {
      FMLMissingMappingsEvent.MissingMapping mapping=new FMLMissingMappingsEvent.MissingMapping((isBlock ? '\u0001' : '\u0020') + name,i);
      ListMultimap<String,FMLMissingMappingsEvent.MissingMapping> missingMapping=ArrayListMultimap.create();
      missingMapping.put(modName,mapping);
      FMLMissingMappingsEvent event=new FMLMissingMappingsEvent(missingMapping);
      for (      ModContainer container : Loader.instance().getModList()) {
        if (container instanceof FMLModContainer) {
          event.applyModContainer(container);
          ((FMLModContainer)container).handleModStateEvent(event);
          if (mapping.getAction() != FMLMissingMappingsEvent.Action.DEFAULT) {
            break;
          }
        }
      }
      if (mapping.getAction() == FMLMissingMappingsEvent.Action.REMAP) {
        return mapping.getTarget();
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return null;
}

Fixed version (ground truth):
private Object getMissingMappingFromFML(boolean isBlock,String name,int i){
  String modName=name.split("String_Node_Str")[0];
  if (Loader.isModLoaded(modName)) {
    try {
      FMLMissingMappingsEvent.MissingMapping mapping=new FMLMissingMappingsEvent.MissingMapping(isBlock ? GameRegistry.Type.BLOCK : GameRegistry.Type.ITEM,name,i);
      ListMultimap<String,FMLMissingMappingsEvent.MissingMapping> missingMapping=ArrayListMultimap.create();
      missingMapping.put(modName,mapping);
      FMLMissingMappingsEvent event=new FMLMissingMappingsEvent(missingMapping);
      for (      ModContainer container : Loader.instance().getModList()) {
        if (container instanceof FMLModContainer) {
          event.applyModContainer(container);
          ((FMLModContainer)container).handleModStateEvent(event);
          if (mapping.getAction() != FMLMissingMappingsEvent.Action.DEFAULT) {
            break;
          }
        }
      }
      if (mapping.getAction() == FMLMissingMappingsEvent.Action.REMAP) {
        return mapping.getTarget();
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return null;
}
Program: 156717
Project: 156717
Buggy source:
/** 
 * Relocates a stack nbt from the world referential to the registry referential.
 */
public void stackToRegistry(NBTTagCompound nbt){
  Item item=Item.getItemById(nbt.getShort("String_Node_Str"));
  nbt.setShort("String_Node_Str",(short)getIdForItem(item));
}

Fixed version (ground truth):
/** 
 * Relocates a stack nbt from the world referential to the registry referential. 
 */
public void stackToRegistry(NBTTagCompound nbt){
  Item item=Item.getItemById(nbt.getShort("String_Node_Str"));
  nbt.setShort("String_Node_Str",(short)getIdForItem(item));
}
Program: 156719
Project: 156719
Buggy source:
/** 
 * Initializes a schematic for blueprint according to an objet placed on {x, y, z} on the world. For blocks, block and meta fields will be initialized automatically.
 */
public void initializeFromObjectAt(IBuilderContext context,int x,int y,int z){
}

Fixed version (ground truth):
/** 
 * Initializes a schematic for blueprint according to an objet placed on {x, y, z} on the world. For blocks, block and meta fields will be initialized automatically.
 */
public void initializeFromObjectAt(IBuilderContext context,BlockPos pos){
}
Program: 156720
Project: 156720
Buggy source:
/** 
 * Return true if the block on the world correspond to the block stored in the blueprint at the location given by the slot. By default, this subprogram is permissive and doesn't take into account metadata. Post processing will be called on these blocks.
 */
public boolean isAlreadyBuilt(IBuilderContext context,int x,int y,int z){
  return true;
}

Fixed version (ground truth):
/** 
 * Return true if the block on the world correspond to the block stored in the blueprint at the location given by the slot. By default, this subprogram is permissive and doesn't take into account metadata. Post processing will be called on these blocks.
 */
public boolean isAlreadyBuilt(IBuilderContext context,BlockPos pos){
  return true;
}
Program: 156721
Project: 156721
Buggy source:
/** 
 * Places the block in the world, at the location specified in the slot, using the stack in parameters
 */
public void placeInWorld(IBuilderContext context,int x,int y,int z,LinkedList<ItemStack> stacks){
}

Fixed version (ground truth):
/** 
 * Places the block in the world, at the location specified in the slot, using the stack in parameters
 */
public void placeInWorld(IBuilderContext context,BlockPos pos,LinkedList<ItemStack> stacks){
}
Program: 156722
Project: 156722
Buggy source:
/** 
 * Write specific requirements coming from the world to the blueprint.
 */
public void storeRequirements(IBuilderContext context,int x,int y,int z){
}

Fixed version (ground truth):
/** 
 * Write specific requirements coming from the world to the blueprint.
 */
public void storeRequirements(IBuilderContext context,BlockPos pos){
}
Program: 156723
Project: 156723
Buggy source:
/** 
 * Called on a block when the blueprint has finished to place all the blocks. This may be useful to adjust variable depending on surrounding blocks that may not be there already at initial building.
 */
public void postProcessing(IBuilderContext context,int x,int y,int z){
}

Fixed version (ground truth):
/** 
 * Called on a block when the blueprint has finished to place all the blocks. This may be useful to adjust variable depending on surrounding blocks that may not be there already at initial building.
 */
public void postProcessing(IBuilderContext context,BlockPos pos){
}
Program: 156724
Project: 156724
Buggy source:
@Override public boolean handle(World world,int x,int y,int z,ForgeDirection direction,ItemStack stack,EntityPlayer player,IStripesActivator activator){
  AxisAlignedBB box=AxisAlignedBB.getBoundingBox(x,y,z,x + 1,y + 1,z + 1);
  List entities=world.getEntitiesWithinAABBExcludingEntity(null,box);
  if (entities.size() <= 0) {
    return false;
  }
  List<EntityLivingBase> livingEntities=new LinkedList<EntityLivingBase>();
  for (  Object entityObj : entities) {
    if (entityObj instanceof EntityLivingBase) {
      livingEntities.add((EntityLivingBase)entityObj);
    }
  }
  player.setCurrentItemOrArmor(0,stack);
  boolean successful=false;
  Collections.shuffle(livingEntities);
  while (livingEntities.size() > 0) {
    EntityLivingBase entity=livingEntities.remove(0);
    if (!player.interactWith(entity)) {
      continue;
    }
    successful=true;
    dropItemsExcept(stack,player,activator,direction);
  }
  if (stack.stackSize > 0 && successful) {
    activator.sendItem(stack,direction.getOpposite());
  }
  return successful;
}

Fixed version (ground truth):
@Override public boolean handle(World world,int x,int y,int z,ForgeDirection direction,ItemStack stack,EntityPlayer player,IStripesActivator activator){
  AxisAlignedBB box=AxisAlignedBB.getBoundingBox(x,y,z,x + 1,y + 1,z + 1);
  List entities=world.getEntitiesWithinAABBExcludingEntity(null,box);
  if (entities.size() <= 0) {
    return false;
  }
  List<EntityLivingBase> livingEntities=new LinkedList<EntityLivingBase>();
  for (  Object entityObj : entities) {
    if (entityObj instanceof EntityLivingBase) {
      livingEntities.add((EntityLivingBase)entityObj);
    }
  }
  player.setCurrentItemOrArmor(0,stack);
  boolean successful=false;
  Collections.shuffle(livingEntities);
  while (livingEntities.size() > 0) {
    EntityLivingBase entity=livingEntities.remove(0);
    if (!player.interactWith(entity)) {
      continue;
    }
    successful=true;
    dropItemsExcept(stack,player,activator,direction);
  }
  if (stack.stackSize > 0 && successful) {
    activator.sendItem(stack,direction.getOpposite());
  }
  player.setCurrentItemOrArmor(0,null);
  return successful;
}
Program: 156725
Project: 156725
Buggy source:
@Override public boolean handle(World world,int x,int y,int z,ForgeDirection direction,ItemStack stack,EntityPlayer player,IStripesActivator activator){
  Block block=world.getBlock(x,y,z);
  if (block instanceof IShearable) {
    IShearable shearableBlock=(IShearable)block;
    if (shearableBlock.isShearable(stack,world,x,y,z)) {
      world.playSoundEffect(x,y,z,Block.soundTypeGrass.getBreakSound(),1,1);
      List<ItemStack> drops=shearableBlock.onSheared(stack,world,x,y,z,EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId,stack));
      world.setBlockToAir(x,y,z);
      stack.damageItem(1,player);
      activator.sendItem(stack,direction.getOpposite());
      for (      ItemStack dropStack : drops) {
        activator.sendItem(dropStack,direction.getOpposite());
      }
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean handle(World world,int x,int y,int z,ForgeDirection direction,ItemStack stack,EntityPlayer player,IStripesActivator activator){
  Block block=world.getBlock(x,y,z);
  if (block instanceof IShearable) {
    IShearable shearableBlock=(IShearable)block;
    if (shearableBlock.isShearable(stack,world,x,y,z)) {
      world.playSoundEffect(x,y,z,Block.soundTypeGrass.getBreakSound(),1,1);
      List<ItemStack> drops=shearableBlock.onSheared(stack,world,x,y,z,EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId,stack));
      world.setBlockToAir(x,y,z);
      if (stack.attemptDamageItem(1,player.getRNG())) {
        stack.stackSize--;
      }
      if (stack.stackSize > 0) {
        activator.sendItem(stack,direction.getOpposite());
      }
      for (      ItemStack dropStack : drops) {
        activator.sendItem(dropStack,direction.getOpposite());
      }
      return true;
    }
  }
  return false;
}
Program: 156726
Project: 156726
Buggy source:
@Override public float getMaxU(){
  return u + (uScale * w / icon.getIconWidth());
}

Fixed version (ground truth):
@Override public float getMaxU(){
  return u + (uScale * w / iw);
}
Program: 156727
Project: 156727
Buggy source:
public SubIcon(IIcon icon,int u,int v,int w,int h){
  this.icon=icon;
  this.uScale=icon.getMaxU() - icon.getMinU();
  this.vScale=icon.getMaxV() - icon.getMinV();
  this.u=icon.getMinU() + (this.uScale * u / icon.getIconWidth());
  this.v=icon.getMinV() + (this.vScale * v / icon.getIconHeight());
  this.w=w;
  this.h=h;
}

Fixed version (ground truth):
public SubIcon(IIcon icon,int u,int v,int w,int h){
  iw=icon.getIconWidth();
  ih=icon.getIconHeight();
  if (Minecraft.getMinecraft().gameSettings.anisotropicFiltering > 1) {
    iw-=16;
    ih-=16;
  }
  this.icon=icon;
  this.uScale=icon.getMaxU() - icon.getMinU();
  this.vScale=icon.getMaxV() - icon.getMinV();
  this.u=icon.getMinU() + (this.uScale * u / iw);
  this.v=icon.getMinV() + (this.vScale * v / ih);
  this.w=w;
  this.h=h;
}
Program: 156728
Project: 156728
Buggy source:
@Override public float getInterpolatedU(double uu){
  return u + (uScale * (float)uu / (float)icon.getIconWidth());
}

Fixed version (ground truth):
@Override public float getInterpolatedU(double uu){
  return u + (uScale * (float)uu / (float)iw);
}
Program: 156729
Project: 156729
Buggy source:
@Override public float getMaxV(){
  return v + (vScale * h / icon.getIconHeight());
}

Fixed version (ground truth):
@Override public float getMaxV(){
  return v + (vScale * h / ih);
}
Program: 156730
Project: 156730
Buggy source:
@Override public float getInterpolatedV(double vv){
  return v + (vScale * (float)vv / (float)icon.getIconHeight());
}

Fixed version (ground truth):
@Override public float getInterpolatedV(double vv){
  return v + (vScale * (float)vv / (float)ih);
}
Program: 156732
Project: 156732
Buggy source:
@Override public int hashCode(){
  int result=7;
  if (stack != null) {
    result=31 * result + stack.getItem().hashCode();
    result=31 * result + stack.getItemDamage();
    result=31 * result + objectHashCode(stack.getTagCompound());
  }
  result=31 * result + 7;
  if (fluidStack != null) {
    result=31 * result + fluidStack.fluidID;
    result=31 * result + fluidStack.amount;
    result=31 * result + objectHashCode(fluidStack.tag);
  }
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  int result=7;
  if (stack != null) {
    result=31 * result + stack.getItem().hashCode();
    result=31 * result + stack.getItemDamage();
    result=31 * result + objectHashCode(stack.getTagCompound());
  }
  result=31 * result + 7;
  if (fluidStack != null) {
    result=31 * result + fluidStack.getFluid().getID();
    result=31 * result + fluidStack.amount;
    result=31 * result + objectHashCode(fluidStack.tag);
  }
  return result;
}
Program: 156733
Project: 156733
Buggy source:
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || o.getClass() != StackKey.class) {
    return false;
  }
  StackKey k=(StackKey)o;
  if ((stack == null ^ k.stack == null) || (fluidStack == null ^ k.fluidStack == null)) {
    return false;
  }
  if (stack != null) {
    if (stack.getItem() != k.stack.getItem() || stack.getHasSubtypes() && stack.getItemDamage() != k.stack.getItemDamage() || !objectsEqual(stack.getTagCompound(),k.stack.getTagCompound())) {
      return false;
    }
  }
  if (fluidStack != null) {
    if (fluidStack.fluidID != k.fluidStack.fluidID || fluidStack.amount != k.fluidStack.amount || !objectsEqual(fluidStack.tag,k.fluidStack.tag)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || o.getClass() != StackKey.class) {
    return false;
  }
  StackKey k=(StackKey)o;
  if ((stack == null ^ k.stack == null) || (fluidStack == null ^ k.fluidStack == null)) {
    return false;
  }
  if (stack != null) {
    if (stack.getItem() != k.stack.getItem() || stack.getHasSubtypes() && stack.getItemDamage() != k.stack.getItemDamage() || !objectsEqual(stack.getTagCompound(),k.stack.getTagCompound())) {
      return false;
    }
  }
  if (fluidStack != null) {
    if (fluidStack.getFluid().getID() != k.fluidStack.getFluid().getID() || fluidStack.amount != k.fluidStack.amount || !objectsEqual(fluidStack.tag,k.fluidStack.tag)) {
      return false;
    }
  }
  return true;
}
Program: 156735
Project: 156735
Buggy source:
@Override public void readFromNBT(NBTTagCompound nbttagcompound){
  super.readFromNBT(nbttagcompound);
  if (nbttagcompound.hasKey("String_Node_Str")) {
    fluidType=FluidStack.loadFluidStackFromNBT(nbttagcompound.getCompoundTag("String_Node_Str"));
  }
 else {
    fluidType=null;
  }
  for (  ForgeDirection direction : orientations) {
    if (nbttagcompound.hasKey("String_Node_Str" + direction.ordinal() + "String_Node_Str")) {
      NBTTagCompound compound=nbttagcompound.getCompoundTag("String_Node_Str" + direction.ordinal() + "String_Node_Str");
      if (compound.hasKey("String_Node_Str")) {
        FluidStack stack=FluidStack.loadFluidStackFromNBT(compound);
        if (fluidType == null) {
          fluidType=stack;
        }
        if (stack.isFluidEqual(fluidType)) {
          sections[direction.ordinal()].readFromNBT(nbttagcompound);
        }
      }
 else {
        sections[direction.ordinal()].readFromNBT(nbttagcompound);
      }
    }
    if (direction != ForgeDirection.UNKNOWN) {
      transferState[direction.ordinal()]=TransferState.values()[nbttagcompound.getShort("String_Node_Str" + direction.ordinal() + "String_Node_Str")];
    }
  }
}

Fixed version (ground truth):
@Override public void readFromNBT(NBTTagCompound nbttagcompound){
  super.readFromNBT(nbttagcompound);
  if (nbttagcompound.hasKey("String_Node_Str")) {
    fluidType=FluidStack.loadFluidStackFromNBT(nbttagcompound.getCompoundTag("String_Node_Str"));
  }
 else {
    fluidType=null;
  }
  for (  ForgeDirection direction : orientations) {
    if (nbttagcompound.hasKey("String_Node_Str" + direction.ordinal() + "String_Node_Str")) {
      NBTTagCompound compound=nbttagcompound.getCompoundTag("String_Node_Str" + direction.ordinal() + "String_Node_Str");
      if (compound.hasKey("String_Node_Str")) {
        FluidStack stack=FluidStack.loadFluidStackFromNBT(compound);
        if (fluidType == null) {
          fluidType=stack;
        }
        if (stack.isFluidEqual(fluidType)) {
          sections[direction.ordinal()].readFromNBT(compound);
        }
      }
 else {
        sections[direction.ordinal()].readFromNBT(compound);
      }
    }
    if (direction != ForgeDirection.UNKNOWN) {
      transferState[direction.ordinal()]=TransferState.values()[nbttagcompound.getShort("String_Node_Str" + direction.ordinal() + "String_Node_Str")];
    }
  }
}
Program: 156736
Project: 156736
Buggy source:
public void initFromPipe(Class<? extends Pipe> pipeClass){
  capacity=LIQUID_IN_PIPE;
  flowRate=fluidCapacities.get(pipeClass);
  travelDelay=MathUtils.clamp(Math.round(16 / (flowRate / 10)),1,12);
  for (  ForgeDirection direction : orientations) {
    sections[direction.ordinal()]=new PipeSection();
  }
}

Fixed version (ground truth):
public void initFromPipe(Class<? extends Pipe> pipeClass){
  capacity=LIQUID_IN_PIPE;
  flowRate=fluidCapacities.get(pipeClass);
  travelDelay=MathUtils.clamp(Math.round(16 / (flowRate / 10)),1,MAX_TRAVEL_DELAY);
}
Program: 156737
Project: 156737
Buggy source:
@Override public void writeToNBT(NBTTagCompound nbttagcompound){
  super.writeToNBT(nbttagcompound);
  NBTTagCompound fluidTag=new NBTTagCompound();
  if (fluidType != null) {
    fluidType.writeToNBT(fluidTag);
    nbttagcompound.setTag("String_Node_Str",fluidTag);
  }
  for (  ForgeDirection direction : orientations) {
    NBTTagCompound subTag=new NBTTagCompound();
    sections[direction.ordinal()].writeToNBT(subTag);
    nbttagcompound.setTag("String_Node_Str" + direction.ordinal() + "String_Node_Str",subTag);
    if (direction != ForgeDirection.UNKNOWN) {
      nbttagcompound.setShort("String_Node_Str" + direction.ordinal() + "String_Node_Str",(short)transferState[direction.ordinal()].ordinal());
    }
  }
}

Fixed version (ground truth):
@Override public void writeToNBT(NBTTagCompound nbttagcompound){
  super.writeToNBT(nbttagcompound);
  if (fluidType != null) {
    NBTTagCompound fluidTag=new NBTTagCompound();
    fluidType.writeToNBT(fluidTag);
    nbttagcompound.setTag("String_Node_Str",fluidTag);
    for (    ForgeDirection direction : orientations) {
      NBTTagCompound subTag=new NBTTagCompound();
      sections[direction.ordinal()].writeToNBT(subTag);
      nbttagcompound.setTag("String_Node_Str" + direction.ordinal() + "String_Node_Str",subTag);
      if (direction != ForgeDirection.UNKNOWN) {
        nbttagcompound.setShort("String_Node_Str" + direction.ordinal() + "String_Node_Str",(short)transferState[direction.ordinal()].ordinal());
      }
    }
  }
}
Program: 156738
Project: 156738
Buggy source:
public PipeTransportFluids(){
  for (  ForgeDirection direction : directions) {
    transferState[direction.ordinal()]=TransferState.None;
  }
}

Fixed version (ground truth):
public PipeTransportFluids(){
  for (  ForgeDirection direction : directions) {
    sections[direction.ordinal()]=new PipeSection();
    transferState[direction.ordinal()]=TransferState.None;
  }
  sections[6]=new PipeSection();
}
Program: 156740
Project: 156740
Buggy source:
public void write(NBTTagCompound nbt){
  NBTTagList blocksMapping=new NBTTagList();
  for (  Block b : idToBlock) {
    NBTTagCompound sub=new NBTTagCompound();
    String name=Block.blockRegistry.getNameForObject(b);
    if (name == null || name.length() == 0) {
      BCLog.logger.error("String_Node_Str" + b.getUnlocalizedName() + "String_Node_Str"+ b.getClass().getName()+ "String_Node_Str");
    }
 else {
      sub.setString("String_Node_Str",name);
    }
    blocksMapping.appendTag(sub);
  }
  nbt.setTag("String_Node_Str",blocksMapping);
  NBTTagList itemsMapping=new NBTTagList();
  for (  Item i : idToItem) {
    NBTTagCompound sub=new NBTTagCompound();
    String name=Item.itemRegistry.getNameForObject(i);
    if (name == null || name.length() == 0) {
      BCLog.logger.error("String_Node_Str" + i.getUnlocalizedName() + "String_Node_Str"+ i.getClass().getName()+ "String_Node_Str");
    }
 else {
      sub.setString("String_Node_Str",name);
    }
    itemsMapping.appendTag(sub);
  }
  nbt.setTag("String_Node_Str",itemsMapping);
  NBTTagList entitiesMapping=new NBTTagList();
  for (  Class<? extends Entity> e : idToEntity) {
    NBTTagCompound sub=new NBTTagCompound();
    sub.setString("String_Node_Str",e.getCanonicalName());
    entitiesMapping.appendTag(sub);
  }
  nbt.setTag("String_Node_Str",entitiesMapping);
}

Fixed version (ground truth):
public void write(NBTTagCompound nbt){
  NBTTagList blocksMapping=new NBTTagList();
  for (  Block b : idToBlock) {
    NBTTagCompound sub=new NBTTagCompound();
    if (b != null) {
      String name=Block.blockRegistry.getNameForObject(b);
      if (name == null || name.length() == 0) {
        BCLog.logger.error("String_Node_Str" + b.getUnlocalizedName() + "String_Node_Str"+ b.getClass().getName()+ "String_Node_Str");
      }
 else {
        sub.setString("String_Node_Str",name);
      }
    }
    blocksMapping.appendTag(sub);
  }
  nbt.setTag("String_Node_Str",blocksMapping);
  NBTTagList itemsMapping=new NBTTagList();
  for (  Item i : idToItem) {
    NBTTagCompound sub=new NBTTagCompound();
    if (i != null) {
      String name=Item.itemRegistry.getNameForObject(i);
      if (name == null || name.length() == 0) {
        BCLog.logger.error("String_Node_Str" + i.getUnlocalizedName() + "String_Node_Str"+ i.getClass().getName()+ "String_Node_Str");
      }
 else {
        sub.setString("String_Node_Str",name);
      }
    }
    itemsMapping.appendTag(sub);
  }
  nbt.setTag("String_Node_Str",itemsMapping);
  NBTTagList entitiesMapping=new NBTTagList();
  for (  Class<? extends Entity> e : idToEntity) {
    NBTTagCompound sub=new NBTTagCompound();
    sub.setString("String_Node_Str",e.getCanonicalName());
    entitiesMapping.appendTag(sub);
  }
  nbt.setTag("String_Node_Str",entitiesMapping);
}
Program: 156741
Project: 156741
Buggy source:
public void scanAndTranslateStacksToWorld(NBTTagCompound nbt) throws MappingNotFoundException {
  if (isStackLayout(nbt)) {
    stackToWorld(nbt);
  }
  for (  Object keyO : nbt.func_150296_c()) {
    String key=(String)keyO;
    if (nbt.getTag(key) instanceof NBTTagCompound) {
      try {
        scanAndTranslateStacksToWorld(nbt.getCompoundTag(key));
      }
 catch (      MappingNotFoundException e) {
        nbt.removeTag(key);
      }
    }
    if (nbt.getTag(key) instanceof NBTTagList) {
      NBTTagList list=(NBTTagList)nbt.getTag(key);
      if (list.func_150303_d() == Constants.NBT.TAG_COMPOUND) {
        for (int i=list.tagCount() - 1; i >= 0; --i) {
          try {
            scanAndTranslateStacksToWorld(list.getCompoundTagAt(i));
          }
 catch (          MappingNotFoundException e) {
            list.removeTag(i);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void scanAndTranslateStacksToWorld(NBTTagCompound nbt) throws MappingNotFoundException {
  if (isStackLayout(nbt)) {
    stackToWorld(nbt);
  }
  for (  Object keyO : new HashSet(nbt.func_150296_c())) {
    String key=(String)keyO;
    if (nbt.getTag(key) instanceof NBTTagCompound) {
      try {
        scanAndTranslateStacksToWorld(nbt.getCompoundTag(key));
      }
 catch (      MappingNotFoundException e) {
        nbt.removeTag(key);
      }
    }
    if (nbt.getTag(key) instanceof NBTTagList) {
      NBTTagList list=(NBTTagList)nbt.getTag(key);
      if (list.func_150303_d() == Constants.NBT.TAG_COMPOUND) {
        for (int i=list.tagCount() - 1; i >= 0; --i) {
          try {
            scanAndTranslateStacksToWorld(list.getCompoundTagAt(i));
          }
 catch (          MappingNotFoundException e) {
            list.removeTag(i);
          }
        }
      }
    }
  }
}
Program: 156742
Project: 156742
Buggy source:
public void scanAndTranslateStacksToWorld(NBTTagCompound nbt) throws MappingNotFoundException {
  if (isStackLayout(nbt)) {
    stackToWorld(nbt);
  }
  for (  Object keyO : nbt.func_150296_c()) {
    String key=(String)keyO;
    if (nbt.getTag(key) instanceof NBTTagCompound) {
      try {
        scanAndTranslateStacksToWorld(nbt.getCompoundTag(key));
      }
 catch (      MappingNotFoundException e) {
        nbt.removeTag(key);
      }
    }
    if (nbt.getTag(key) instanceof NBTTagList) {
      NBTTagList list=(NBTTagList)nbt.getTag(key);
      if (list.func_150303_d() == Constants.NBT.TAG_COMPOUND) {
        for (int i=list.tagCount() - 1; i >= 0; --i) {
          try {
            scanAndTranslateStacksToWorld(list.getCompoundTagAt(i));
          }
 catch (          MappingNotFoundException e) {
            list.removeTag(i);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void scanAndTranslateStacksToWorld(NBTTagCompound nbt) throws MappingNotFoundException {
  if (isStackLayout(nbt)) {
    stackToWorld(nbt);
  }
  for (  Object keyO : new HashSet(nbt.func_150296_c())) {
    String key=(String)keyO;
    if (nbt.getTag(key) instanceof NBTTagCompound) {
      try {
        scanAndTranslateStacksToWorld(nbt.getCompoundTag(key));
      }
 catch (      MappingNotFoundException e) {
        nbt.removeTag(key);
      }
    }
    if (nbt.getTag(key) instanceof NBTTagList) {
      NBTTagList list=(NBTTagList)nbt.getTag(key);
      if (list.func_150303_d() == Constants.NBT.TAG_COMPOUND) {
        for (int i=list.tagCount() - 1; i >= 0; --i) {
          try {
            scanAndTranslateStacksToWorld(list.getCompoundTagAt(i));
          }
 catch (          MappingNotFoundException e) {
            list.removeTag(i);
          }
        }
      }
    }
  }
}
Program: 156743
Project: 156743
Buggy source:
@Override public void getDebugInfo(List<String> info,ForgeDirection side,ItemStack debugger,EntityPlayer player){
  info.add("String_Node_Str" + board.getNBTHandler().getID() + "String_Node_Str"+ getBattery().getEnergyStored()+ "String_Node_Str"+ getBattery().getMaxEnergyStored()+ "String_Node_Str");
  info.add("String_Node_Str" + posX + "String_Node_Str"+ posY+ "String_Node_Str"+ posZ);
  info.add("String_Node_Str");
  AIRobot aiRobot=mainAI;
  while (aiRobot != null) {
    info.add("String_Node_Str" + RobotManager.getAIRobotName(aiRobot.getClass()) + "String_Node_Str"+ aiRobot.getEnergyCost()+ "String_Node_Str");
    aiRobot=aiRobot.getDelegateAI();
  }
}

Fixed version (ground truth):
@Override public void getDebugInfo(List<String> info,ForgeDirection side,ItemStack debugger,EntityPlayer player){
  info.add("String_Node_Str" + board.getNBTHandler().getID() + "String_Node_Str"+ getBattery().getEnergyStored()+ "String_Node_Str"+ getBattery().getMaxEnergyStored()+ "String_Node_Str");
  info.add(String.format("String_Node_Str",posX,posY,posZ));
  info.add("String_Node_Str");
  AIRobot aiRobot=mainAI;
  while (aiRobot != null) {
    info.add("String_Node_Str" + RobotManager.getAIRobotName(aiRobot.getClass()) + "String_Node_Str"+ aiRobot.getEnergyCost()+ "String_Node_Str");
    aiRobot=aiRobot.getDelegateAI();
  }
}
Program: 156744
Project: 156744
Buggy source:
public int extractFluid(IFluidHandler fluidHandler,ForgeDirection side){
  int flowRate=transport.flowRate;
  FluidStack extracted=fluidHandler.drain(side.getOpposite(),liquidToExtract > flowRate ? flowRate : liquidToExtract,false);
  int inserted=0;
  if (extracted != null) {
    inserted=transport.fill(side,extracted,true);
    fluidHandler.drain(side.getOpposite(),inserted,true);
  }
  return inserted;
}

Fixed version (ground truth):
public int extractFluid(IFluidHandler fluidHandler,ForgeDirection side){
  int amount=liquidToExtract > transport.flowRate ? transport.flowRate : liquidToExtract;
  FluidTankInfo tankInfo=transport.getTankInfo(side)[0];
  FluidStack extracted;
  if (tankInfo.fluid != null && tankInfo.fluid.getFluid() != null) {
    extracted=fluidHandler.drain(side.getOpposite(),new FluidStack(tankInfo.fluid.getFluid(),amount),false);
  }
 else {
    extracted=fluidHandler.drain(side.getOpposite(),amount,false);
  }
  int inserted=0;
  if (extracted != null) {
    inserted=transport.fill(side,extracted,true);
    if (inserted > 0) {
      fluidHandler.drain(side.getOpposite(),new FluidStack(extracted.getFluid(),inserted),true);
    }
  }
  return inserted;
}
Program: 156745
Project: 156745
Buggy source:
@Override public void updateEntity(){
  super.updateEntity();
  int meta=container.getBlockMetadata();
  if (liquidToExtract > 0 && meta < 6) {
    ForgeDirection side=ForgeDirection.getOrientation(meta);
    TileEntity tile=container.getTile(side);
    if (tile instanceof IFluidHandler) {
      liquidToExtract-=extractFluid((IFluidHandler)tile,side);
    }
  }
  if (battery.useEnergy(10,10,false) > 0) {
    if (meta > 5) {
      return;
    }
    TileEntity tile=container.getTile(ForgeDirection.getOrientation(meta));
    if (tile instanceof IFluidHandler) {
      if (liquidToExtract <= FluidContainerRegistry.BUCKET_VOLUME) {
        liquidToExtract+=FluidContainerRegistry.BUCKET_VOLUME;
      }
    }
  }
}

Fixed version (ground truth):
@Override public void updateEntity(){
  super.updateEntity();
  int meta=container.getBlockMetadata();
  if (meta >= 6) {
    battery.setEnergy(0);
    liquidToExtract=0;
    return;
  }
  if (liquidToExtract > 0 && meta < 6) {
    ForgeDirection side=ForgeDirection.getOrientation(meta);
    TileEntity tile=container.getTile(side);
    if (tile instanceof IFluidHandler) {
      extractFluid((IFluidHandler)tile,side);
      liquidToExtract-=transport.flowRate;
    }
  }
  if (battery.useEnergy(10,10,false) > 0) {
    TileEntity tile=container.getTile(ForgeDirection.getOrientation(meta));
    if (tile instanceof IFluidHandler) {
      if (liquidToExtract <= FluidContainerRegistry.BUCKET_VOLUME) {
        liquidToExtract+=FluidContainerRegistry.BUCKET_VOLUME;
      }
    }
  }
}
Program: 156746
Project: 156746
Buggy source:
@Override public boolean renderWorldBlock(IBlockAccess world,int x,int y,int z,Block block,int modelId,RenderBlocks renderer){
  TileEntity tile=world.getTileEntity(x,y,z);
  renderer.setRenderBounds(0,0,0,0,0,0);
  renderer.renderStandardBlock(Blocks.stone,x,y,z);
  renderer.setRenderBoundsFromBlock(block);
  if (tile instanceof TileGenericPipe) {
    TileGenericPipe pipeTile=(TileGenericPipe)tile;
    renderPipe(renderer,world,pipeTile,x,y,z);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean renderWorldBlock(IBlockAccess world,int x,int y,int z,Block block,int modelId,RenderBlocks renderer){
  TileEntity tile=world.getTileEntity(x,y,z);
  Tessellator.instance.addVertexWithUV(x,y,z,0,0);
  Tessellator.instance.addVertexWithUV(x,y,z,0,0);
  Tessellator.instance.addVertexWithUV(x,y,z,0,0);
  Tessellator.instance.addVertexWithUV(x,y,z,0,0);
  if (tile instanceof TileGenericPipe) {
    TileGenericPipe pipeTile=(TileGenericPipe)tile;
    renderPipe(renderer,world,pipeTile,x,y,z);
  }
  return true;
}
Program: 156749
Project: 156749
Buggy source:
public static ResourceId load(NBTTagCompound nbt){
  try {
    Class cls=null;
    if (nbt.hasKey("String_Node_Str")) {
      cls=RobotManager.getResourceIdByLegacyClassName(nbt.getString("String_Node_Str"));
    }
 else {
      cls=RobotManager.getResourceIdByName("String_Node_Str");
    }
    ResourceId id=(ResourceId)cls.newInstance();
    id.readFromNBT(nbt);
    return id;
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
public static ResourceId load(NBTTagCompound nbt){
  try {
    Class cls=null;
    if (nbt.hasKey("String_Node_Str")) {
      cls=RobotManager.getResourceIdByLegacyClassName(nbt.getString("String_Node_Str"));
    }
 else {
      cls=RobotManager.getResourceIdByName(nbt.getString("String_Node_Str"));
    }
    ResourceId id=(ResourceId)cls.newInstance();
    id.readFromNBT(nbt);
    return id;
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
  return null;
}
Program: 156750
Project: 156750
Buggy source:
public int extractFluid(IFluidHandler fluidHandler,ForgeDirection side){
  int flowRate=transport.flowRate;
  FluidStack extracted=fluidHandler.drain(side.getOpposite(),liquidToExtract > flowRate ? flowRate : liquidToExtract,false);
  int inserted=0;
  if (extracted != null) {
    inserted=transport.fill(side,extracted,true);
    fluidHandler.drain(side.getOpposite(),inserted,true);
  }
  return inserted;
}

Fixed version (ground truth):
public int extractFluid(IFluidHandler fluidHandler,ForgeDirection side){
  int amount=liquidToExtract > transport.flowRate ? transport.flowRate : liquidToExtract;
  FluidTankInfo tankInfo=transport.getTankInfo(side)[0];
  FluidStack extracted;
  if (tankInfo.fluid != null && tankInfo.fluid.getFluid() != null) {
    extracted=fluidHandler.drain(side.getOpposite(),new FluidStack(tankInfo.fluid.getFluid(),amount),false);
  }
 else {
    extracted=fluidHandler.drain(side.getOpposite(),amount,false);
  }
  int inserted=0;
  if (extracted != null) {
    inserted=transport.fill(side,extracted,true);
    if (inserted > 0) {
      fluidHandler.drain(side.getOpposite(),new FluidStack(extracted.getFluid(),inserted),true);
    }
  }
  return inserted;
}
Program: 156751
Project: 156751
Buggy source:
@Override public void updateEntity(){
  super.updateEntity();
  int meta=container.getBlockMetadata();
  if (liquidToExtract > 0 && meta < 6) {
    ForgeDirection side=ForgeDirection.getOrientation(meta);
    TileEntity tile=container.getTile(side);
    if (tile instanceof IFluidHandler) {
      liquidToExtract-=extractFluid((IFluidHandler)tile,side);
    }
  }
  if (battery.useEnergy(10,10,false) > 0) {
    if (meta > 5) {
      return;
    }
    TileEntity tile=container.getTile(ForgeDirection.getOrientation(meta));
    if (tile instanceof IFluidHandler) {
      if (liquidToExtract <= FluidContainerRegistry.BUCKET_VOLUME) {
        liquidToExtract+=FluidContainerRegistry.BUCKET_VOLUME;
      }
    }
  }
}

Fixed version (ground truth):
@Override public void updateEntity(){
  super.updateEntity();
  int meta=container.getBlockMetadata();
  if (meta >= 6) {
    battery.setEnergy(0);
    liquidToExtract=0;
    return;
  }
  if (liquidToExtract > 0 && meta < 6) {
    ForgeDirection side=ForgeDirection.getOrientation(meta);
    TileEntity tile=container.getTile(side);
    if (tile instanceof IFluidHandler) {
      extractFluid((IFluidHandler)tile,side);
      liquidToExtract-=transport.flowRate;
    }
  }
  if (battery.useEnergy(10,10,false) > 0) {
    TileEntity tile=container.getTile(ForgeDirection.getOrientation(meta));
    if (tile instanceof IFluidHandler) {
      if (liquidToExtract <= FluidContainerRegistry.BUCKET_VOLUME) {
        liquidToExtract+=FluidContainerRegistry.BUCKET_VOLUME;
      }
    }
  }
}