nus-yam/ex-repair huggingface dataset:
Program: 95703
Project: 95703
Buggy source:
public static void init(FMLPreInitializationEvent event){
  directory=event.getModConfigurationDirectory().toString() + '/' + Reference.MOD_ID.toLowerCase()+ '/';
  if (config == null) {
    config=new Configuration(new File(directory,"String_Node_Str"));
    loadConfiguration();
  }
  LogHelper.info("String_Node_Str");
}

Fixed version (ground truth):
public static void init(FMLPreInitializationEvent event){
  directory=event.getModConfigurationDirectory().toString() + '/' + Reference.MOD_ID.toLowerCase()+ '/';
  if (config == null) {
    config=new Configuration(new File(directory,"String_Node_Str"));
    loadConfiguration();
  }
  LogHelper.debug("String_Node_Str");
}
Program: 95704
Project: 95704
Buggy source:
@SubscribeEvent public void onCOnfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event){
  if (event.modID.equals(Reference.MOD_ID)) {
    loadConfiguration();
    LogHelper.info("String_Node_Str");
  }
}

Fixed version (ground truth):
@SubscribeEvent public void onCOnfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event){
  if (event.modID.equals(Reference.MOD_ID)) {
    loadConfiguration();
    LogHelper.debug("String_Node_Str");
  }
}
Program: 95705
Project: 95705
Buggy source:
public static void init(){
  blockCrop=new BlockCrop();
  RegisterHelper.registerBlock(blockCrop,Names.Objects.crops);
  seedAnalyzer=new BlockSeedAnalyzer();
  RegisterHelper.registerBlock(seedAnalyzer,Names.Objects.seedAnalyzer);
  if (!ConfigurationHandler.disableIrrigation) {
    blockWaterTank=new BlockWaterTank();
    RegisterHelper.registerBlock(blockWaterTank,Names.Objects.tank,ItemBlockCustomWood.class);
    blockWaterChannel=new BlockWaterChannel();
    RegisterHelper.registerBlock(blockWaterChannel,Names.Objects.channel,ItemBlockCustomWood.class);
    blockChannelValve=new BlockChannelValve();
    RegisterHelper.registerBlock(blockChannelValve,Names.Objects.valve,ItemBlockCustomWood.class);
    blockSprinkler=new BlockSprinkler();
    RegisterHelper.registerBlock(blockSprinkler,Names.Objects.sprinkler);
  }
  if (!ConfigurationHandler.disableSeedStorage) {
    blockSeedStorage=new BlockSeedStorage();
    RegisterHelper.registerBlock(blockSeedStorage,Names.Objects.seedStorage,ItemBlockCustomWood.class);
    if (!ConfigurationHandler.disableSeedWarehouse) {
      blockSeedStorageController=new BlockSeedStorageController();
      RegisterHelper.registerBlock(blockSeedStorageController,Names.Objects.seedStorageController,ItemBlockCustomWood.class);
    }
  }
  LogHelper.info("String_Node_Str");
}

Fixed version (ground truth):
public static void init(){
  blockCrop=new BlockCrop();
  RegisterHelper.registerBlock(blockCrop,Names.Objects.crops);
  seedAnalyzer=new BlockSeedAnalyzer();
  RegisterHelper.registerBlock(seedAnalyzer,Names.Objects.seedAnalyzer);
  if (!ConfigurationHandler.disableIrrigation) {
    blockWaterTank=new BlockWaterTank();
    RegisterHelper.registerBlock(blockWaterTank,Names.Objects.tank,ItemBlockCustomWood.class);
    blockWaterChannel=new BlockWaterChannel();
    RegisterHelper.registerBlock(blockWaterChannel,Names.Objects.channel,ItemBlockCustomWood.class);
    blockChannelValve=new BlockChannelValve();
    RegisterHelper.registerBlock(blockChannelValve,Names.Objects.valve,ItemBlockCustomWood.class);
    blockSprinkler=new BlockSprinkler();
    RegisterHelper.registerBlock(blockSprinkler,Names.Objects.sprinkler);
  }
  if (!ConfigurationHandler.disableSeedStorage) {
    blockSeedStorage=new BlockSeedStorage();
    RegisterHelper.registerBlock(blockSeedStorage,Names.Objects.seedStorage,ItemBlockCustomWood.class);
    if (!ConfigurationHandler.disableSeedWarehouse) {
      blockSeedStorageController=new BlockSeedStorageController();
      RegisterHelper.registerBlock(blockSeedStorageController,Names.Objects.seedStorageController,ItemBlockCustomWood.class);
    }
  }
  LogHelper.debug("String_Node_Str");
}
Program: 95708
Project: 95708
Buggy source:
public static void init(){
  crops=new ItemCrop();
  RegisterHelper.registerItem(crops,Names.Objects.crops + "String_Node_Str");
  journal=new ItemJournal();
  RegisterHelper.registerItem(journal,Names.Objects.journal);
  trowel=new ItemTrowel();
  RegisterHelper.registerItem(trowel,Names.Objects.trowel);
  magnifyingGlass=new ItemMagnifyingGlass();
  RegisterHelper.registerItem(magnifyingGlass,Names.Objects.magnifyingGlass);
  if (!ConfigurationHandler.disableIrrigation) {
    sprinkler=new ItemSprinkler();
    RegisterHelper.registerItem(sprinkler,Names.Objects.sprinkler + "String_Node_Str");
  }
  debugItem=new ItemDebugger();
  RegisterHelper.registerItem(debugItem,"String_Node_Str");
  if (ConfigurationHandler.enableHandRake) {
    handRake=new ItemHandRake();
    RegisterHelper.registerItem(handRake,Names.Objects.handRake);
  }
  LogHelper.info("String_Node_Str");
}

Fixed version (ground truth):
public static void init(){
  crops=new ItemCrop();
  RegisterHelper.registerItem(crops,Names.Objects.crops + "String_Node_Str");
  journal=new ItemJournal();
  RegisterHelper.registerItem(journal,Names.Objects.journal);
  trowel=new ItemTrowel();
  RegisterHelper.registerItem(trowel,Names.Objects.trowel);
  magnifyingGlass=new ItemMagnifyingGlass();
  RegisterHelper.registerItem(magnifyingGlass,Names.Objects.magnifyingGlass);
  if (!ConfigurationHandler.disableIrrigation) {
    sprinkler=new ItemSprinkler();
    RegisterHelper.registerItem(sprinkler,Names.Objects.sprinkler + "String_Node_Str");
  }
  debugItem=new ItemDebugger();
  RegisterHelper.registerItem(debugItem,"String_Node_Str");
  if (ConfigurationHandler.enableHandRake) {
    handRake=new ItemHandRake();
    RegisterHelper.registerItem(handRake,Names.Objects.handRake);
  }
  LogHelper.debug("String_Node_Str");
}
Program: 95713
Project: 95713
Buggy source:
public static void registerBlock(Block block,String name,Class<? extends ItemBlock> itemClass){
  block.setBlockName(Reference.MOD_ID.toLowerCase() + ':' + name);
  LogHelper.info("String_Node_Str" + block.getUnlocalizedName());
  if (itemClass != null) {
    GameRegistry.registerBlock(block,itemClass,name);
  }
 else {
    GameRegistry.registerBlock(block,name);
  }
}

Fixed version (ground truth):
public static void registerBlock(Block block,String name,Class<? extends ItemBlock> itemClass){
  block.setBlockName(Reference.MOD_ID.toLowerCase() + ':' + name);
  LogHelper.debug("String_Node_Str" + block.getUnlocalizedName());
  if (itemClass != null) {
    GameRegistry.registerBlock(block,itemClass,name);
  }
 else {
    GameRegistry.registerBlock(block,name);
  }
}
Program: 95714
Project: 95714
Buggy source:
public static void registerItem(Item item,String name){
  item.setUnlocalizedName(Reference.MOD_ID.toLowerCase() + ':' + name);
  LogHelper.info("String_Node_Str" + item.getUnlocalizedName());
  GameRegistry.registerItem(item,name);
}

Fixed version (ground truth):
public static void registerItem(Item item,String name){
  item.setUnlocalizedName(Reference.MOD_ID.toLowerCase() + ':' + name);
  LogHelper.debug("String_Node_Str" + item.getUnlocalizedName());
  GameRegistry.registerItem(item,name);
}
Program: 95715
Project: 95715
Buggy source:
@SubscribeEvent public void onTick(TickEvent.ServerTickEvent event){
  if (!Constants.LOG_RENDER_CALLS)   return;
  timer++;
  if (timer % 40 == 0) {
    timer=0;
    int callsPerSecond=RenderChannel.renderCallCounter.getAndSet(0);
    LogHelper.info("String_Node_Str" + callsPerSecond);
  }
}

Fixed version (ground truth):
@SubscribeEvent public void onTick(TickEvent.ServerTickEvent event){
  if (!Constants.LOG_RENDER_CALLS)   return;
  timer++;
  if (timer % 40 == 0) {
    timer=0;
    int callsPerSecond=RenderChannel.renderCallCounter.getAndSet(0);
    LogHelper.debug("String_Node_Str" + callsPerSecond);
  }
}
Program: 95716
Project: 95716
Buggy source:
@Override public void undo(){
  crop.products.addProduce(fruit,weight);
}

Fixed version (ground truth):
@Override public void undo(){
  crop.products.addProduce(fruit,weight);
  String oreDictTag=this.fruitTag();
  LogHelper.debug("String_Node_Str" + fruit.getDisplayName() + "String_Node_Str"+ oreDictTag);
  if (!OreDictHelper.hasOreId(fruit,oreDictTag)) {
    OreDictionary.registerOre(oreDictTag,fruit);
  }
}
Program: 95717
Project: 95717
Buggy source:
@Override public void apply(){
  crop.products.removeProduce(fruit);
}

Fixed version (ground truth):
@Override public void apply(){
  crop.products.removeProduce(fruit);
  MCOreDictEntry ore=new MCOreDictEntry(this.fruitTag());
  ore.remove(new MCItemStack(this.fruit));
}
Program: 95718
Project: 95718
Buggy source:
@Override public boolean canBlockStay(World world,int x,int y,int z){
  Block soil=world.getBlock(x,y - 1,z);
  int soilMeta=world.getBlockMetadata(x,y - 1,z);
  return GrowthRequirements.isSoilValid(soil,soilMeta);
}

Fixed version (ground truth):
@Override public boolean canBlockStay(World world,int x,int y,int z){
  return GrowthRequirements.isSoilValid(world,x,y - 1,z);
}
Program: 95720
Project: 95720
Buggy source:
/** 
 * @return true, if the given block is a valid soil 
 */
public boolean isValidSoil(Block block,int meta){
  if (this.requiresSpecificSoil()) {
    return this.soil.equals(new BlockWithMeta(block,meta));
  }
 else {
    return GrowthRequirements.defaultSoils.contains(new BlockWithMeta(block,meta));
  }
}

Fixed version (ground truth):
/** 
 * @return true, if the given block is a valid soil 
 */
public boolean isValidSoil(World world,int x,int y,int z){
  Block block=world.getBlock(x,y,z);
  int meta=world.getBlockMetadata(x,y,z);
  BlockWithMeta soil=new BlockWithMeta(block,meta);
  if (ModIntegration.LoadedMods.gardenStuff && block instanceof BlockLargePot) {
    soil=GardenStuffHelper.getSoil((TileEntityGarden)world.getTileEntity(x,y,z));
  }
  if (this.requiresSpecificSoil()) {
    return this.soil.equals(soil);
  }
 else {
    return GrowthRequirements.defaultSoils.contains(soil);
  }
}
Program: 95721
Project: 95721
Buggy source:
/** 
 * @return true, if all the requirements are met 
 */
public boolean canGrow(World world,int x,int y,int z){
  return this.isValidSoil(world.getBlock(x,y - 1,z),world.getBlockMetadata(x,y - 1,z)) && this.isBrightnessGood(world.getBlockLightValue(x,y,z)) && this.isBaseBlockPresent(world,x,y,z);
}

Fixed version (ground truth):
/** 
 * @return true, if all the requirements are met 
 */
public boolean canGrow(World world,int x,int y,int z){
  return this.isValidSoil(world,x,y - 1,z) && this.isBrightnessGood(world.getBlockLightValue(x,y,z)) && this.isBaseBlockPresent(world,x,y,z);
}
Program: 95722
Project: 95722
Buggy source:
public static boolean isSoilValid(Block block,int meta){
  BlockWithMeta soil=new BlockWithMeta(block,meta);
  return soils.contains(soil) || defaultSoils.contains(soil);
}

Fixed version (ground truth):
public static boolean isSoilValid(World world,int x,int y,int z){
  Block block=world.getBlock(x,y,z);
  int meta=world.getBlockMetadata(x,y,z);
  BlockWithMeta soil;
  if (ModIntegration.LoadedMods.gardenStuff && block instanceof BlockLargePot) {
    soil=GardenStuffHelper.getSoil((TileEntityGarden)world.getTileEntity(x,y,z));
  }
 else {
    soil=new BlockWithMeta(block,meta);
  }
  return soils.contains(soil) || defaultSoils.contains(soil);
}
Program: 95723
Project: 95723
Buggy source:
public static void initSoils(){
  defaultSoils.add(new BlockWithMeta(Blocks.farmland,7));
  if (ModIntegration.LoadedMods.forestry) {
    defaultSoils.add(new BlockWithMeta((Block)Block.blockRegistry.getObject("String_Node_Str"),0));
  }
  String[] data=IOHelper.getLinesArrayFromData(ConfigurationHandler.readSoils());
  for (  String line : data) {
    LogHelper.debug("String_Node_Str" + line);
    ItemStack stack=IOHelper.getStack(line);
    Block block=(stack != null && stack.getItem() instanceof ItemBlock) ? ((ItemBlock)stack.getItem()).field_150939_a : null;
    boolean success=block != null;
    String errorMsg="String_Node_Str";
    if (success) {
      soils.add(new BlockWithMeta(block,stack.getItemDamage()));
    }
 else {
      LogHelper.info("String_Node_Str" + errorMsg + "String_Node_Str"+ line+ "String_Node_Str");
    }
  }
  LogHelper.info("String_Node_Str");
  for (  BlockWithMeta soil : soils) {
    LogHelper.info("String_Node_Str" + Block.blockRegistry.getNameForObject(soil.getBlock()) + "String_Node_Str"+ soil.getMeta());
  }
}

Fixed version (ground truth):
public static void initSoils(){
  defaultSoils.add(new BlockWithMeta(Blocks.farmland,7));
  if (ModIntegration.LoadedMods.forestry) {
    defaultSoils.add(new BlockWithMeta((Block)Block.blockRegistry.getObject("String_Node_Str"),0));
  }
  if (ModIntegration.LoadedMods.gardenStuff) {
    defaultSoils.add(new BlockWithMeta(ModBlocks.gardenFarmland,0));
  }
  String[] data=IOHelper.getLinesArrayFromData(ConfigurationHandler.readSoils());
  for (  String line : data) {
    LogHelper.debug("String_Node_Str" + line);
    ItemStack stack=IOHelper.getStack(line);
    Block block=(stack != null && stack.getItem() instanceof ItemBlock) ? ((ItemBlock)stack.getItem()).field_150939_a : null;
    boolean success=block != null;
    String errorMsg="String_Node_Str";
    if (success) {
      soils.add(new BlockWithMeta(block,stack.getItemDamage()));
    }
 else {
      LogHelper.info("String_Node_Str" + errorMsg + "String_Node_Str"+ line+ "String_Node_Str");
    }
  }
  LogHelper.info("String_Node_Str");
  for (  BlockWithMeta soil : soils) {
    LogHelper.info("String_Node_Str" + Block.blockRegistry.getNameForObject(soil.getBlock()) + "String_Node_Str"+ soil.getMeta());
  }
}
Program: 95724
Project: 95724
Buggy source:
@SubscribeEvent(priority=EventPriority.HIGHEST) public void onPlayerUseItemEvent(PlayerInteractEvent event){
  if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
    Block block=event.world.getBlock(event.x,event.y,event.z);
    int meta=event.world.getBlockMetadata(event.x,event.y,event.z);
    if (event.entityPlayer.getCurrentEquippedItem() != null && event.entityPlayer.getCurrentEquippedItem().stackSize > 0 && event.entityPlayer.getCurrentEquippedItem().getItem() != null && event.entityPlayer.getCurrentEquippedItem().getItem() instanceof IPlantable) {
      if (GrowthRequirements.isSoilValid(block,meta) || block == Blocks.farmland) {
        if (ConfigurationHandler.disableVanillaFarming) {
          this.denyEvent(event,false);
        }
 else         if (event.entityPlayer.getCurrentEquippedItem().hasTagCompound()) {
          NBTTagCompound tag=(NBTTagCompound)event.entityPlayer.getCurrentEquippedItem().getTagCompound().copy();
          if (tag.hasKey(Names.NBT.growth) && tag.hasKey(Names.NBT.gain) && tag.hasKey(Names.NBT.strength)) {
            this.denyEvent(event,false);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@SubscribeEvent(priority=EventPriority.HIGHEST) public void onPlayerUseItemEvent(PlayerInteractEvent event){
  if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
    Block block=event.world.getBlock(event.x,event.y,event.z);
    if (event.entityPlayer.getCurrentEquippedItem() != null && event.entityPlayer.getCurrentEquippedItem().stackSize > 0 && event.entityPlayer.getCurrentEquippedItem().getItem() != null && event.entityPlayer.getCurrentEquippedItem().getItem() instanceof IPlantable) {
      if (GrowthRequirements.isSoilValid(event.world,event.x,event.y,event.z) || block == Blocks.farmland) {
        if (ConfigurationHandler.disableVanillaFarming) {
          this.denyEvent(event,false);
        }
 else         if (event.entityPlayer.getCurrentEquippedItem().hasTagCompound()) {
          NBTTagCompound tag=(NBTTagCompound)event.entityPlayer.getCurrentEquippedItem().getTagCompound().copy();
          if (tag.hasKey(Names.NBT.growth) && tag.hasKey(Names.NBT.gain) && tag.hasKey(Names.NBT.strength)) {
            this.denyEvent(event,false);
          }
        }
      }
    }
  }
}
Program: 95725
Project: 95725
Buggy source:
@Override public boolean onItemUseFirst(ItemStack stack,EntityPlayer player,World world,int x,int y,int z,int side,float hitX,float hitY,float hitZ){
  if (!world.isRemote) {
    if (GrowthRequirements.isSoilValid(world.getBlock(x,y,z),world.getBlockMetadata(x,y,z)) && world.getBlock(x,y + 1,z).getMaterial() == Material.air && side == 1) {
      world.setBlock(x,y + 1,z,Blocks.blockCrop);
      stack.stackSize=player.capabilities.isCreativeMode ? stack.stackSize : stack.stackSize - 1;
      return false;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onItemUseFirst(ItemStack stack,EntityPlayer player,World world,int x,int y,int z,int side,float hitX,float hitY,float hitZ){
  if (!world.isRemote) {
    if (GrowthRequirements.isSoilValid(world,x,y,z) && world.getBlock(x,y + 1,z).getMaterial() == Material.air && side == 1) {
      world.setBlock(x,y + 1,z,Blocks.blockCrop);
      stack.stackSize=player.capabilities.isCreativeMode ? stack.stackSize : stack.stackSize - 1;
      return false;
    }
  }
  return false;
}
Program: 95726
Project: 95726
Buggy source:
@Override public boolean onItemUse(ItemStack stack,EntityPlayer player,World world,int x,int y,int z,int side,float f1,float f2,float f3){
  if (world.getBlock(x,y,z) == Blocks.blockCrop) {
    LogHelper.debug("String_Node_Str" + stack.getItem().getUnlocalizedName() + "String_Node_Str");
    return true;
  }
  if (GrowthRequirements.getGrowthRequirement((ItemSeeds)stack.getItem(),stack.getItemDamage()).isValidSoil(world.getBlock(x,y,z),world.getBlockMetadata(x,y,z))) {
    super.onItemUse(stack,player,world,x,y,z,side,f1,f2,f3);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onItemUse(ItemStack stack,EntityPlayer player,World world,int x,int y,int z,int side,float f1,float f2,float f3){
  if (world.getBlock(x,y,z) == Blocks.blockCrop) {
    LogHelper.debug("String_Node_Str" + stack.getItem().getUnlocalizedName() + "String_Node_Str");
    return true;
  }
  if (GrowthRequirements.getGrowthRequirement((ItemSeeds)stack.getItem(),stack.getItemDamage()).isValidSoil(world,x,y,z)) {
    super.onItemUse(stack,player,world,x,y,z,side,f1,f2,f3);
  }
  return false;
}
Program: 95728
Project: 95728
Buggy source:
private static void getDebugData(World world,int x,int y,int z,List<String> list){
  if (!world.isRemote) {
    list.add("String_Node_Str");
    list.add("String_Node_Str");
  }
 else {
    list.add("String_Node_Str");
    list.add("String_Node_Str");
  }
  TileEntity tile=world.getTileEntity(x,y,z);
  if (tile != null && tile instanceof IDebuggable) {
    ((IDebuggable)tile).addDebugInfo(list);
  }
 else {
    list.add("String_Node_Str" + Block.blockRegistry.getNameForObject(world.getBlock(x,y,z)));
    list.add("String_Node_Str" + world.getBlockMetadata(x,y,z));
  }
  list.add("String_Node_Str");
}

Fixed version (ground truth):
private static void getDebugData(World world,int x,int y,int z,List<String> list){
  if (!world.isRemote) {
    list.add("String_Node_Str");
    list.add("String_Node_Str");
  }
 else {
    list.add("String_Node_Str");
    list.add("String_Node_Str");
  }
  TileEntity tile=world.getTileEntity(x,y,z);
  if (tile != null && tile instanceof IDebuggable) {
    ((IDebuggable)tile).addDebugInfo(list);
  }
 else   if (ModIntegration.LoadedMods.gardenStuff && tile instanceof TileEntityGarden) {
    GardenStuffHelper.addDebugInfo(list,(TileEntityGarden)tile);
  }
 else {
    list.add("String_Node_Str" + Block.blockRegistry.getNameForObject(world.getBlock(x,y,z)));
    list.add("String_Node_Str" + world.getBlockMetadata(x,y,z));
  }
  list.add("String_Node_Str");
}
Program: 95735
Project: 95735
Buggy source:
@Mod.EventHandler public static void init(FMLInitializationEvent event){
  LogHelper.debug("String_Node_Str");
  ResourceCrops.init();
  Seeds.init();
  NetworkRegistry.INSTANCE.registerGuiHandler(instance,new GuiHandler());
  proxy.registerTileEntities();
  proxy.registerRenderers();
  ModIntegration.init();
  LogHelper.debug("String_Node_Str");
}

Fixed version (ground truth):
@Mod.EventHandler public static void init(FMLInitializationEvent event){
  LogHelper.debug("String_Node_Str");
  Seeds.init();
  NetworkRegistry.INSTANCE.registerGuiHandler(instance,new GuiHandler());
  proxy.registerTileEntities();
  proxy.registerRenderers();
  ModIntegration.init();
  LogHelper.debug("String_Node_Str");
}
Program: 95736
Project: 95736
Buggy source:
@Mod.EventHandler public static void postInit(FMLPostInitializationEvent event){
  LogHelper.debug("String_Node_Str");
  Crops.initBotaniaCrops();
  Recipes.init();
  CustomCrops.initCustomCrops();
  SeedHelper.init();
  MutationHandler.init();
  GrowthRequirements.initSoils();
  CustomCrops.initGrassSeeds();
  if (!ConfigurationHandler.disableWorldGen) {
    WorldGen.init();
  }
  proxy.initNEI();
  proxy.initSeedInfo();
  LogHelper.debug("String_Node_Str");
}

Fixed version (ground truth):
@Mod.EventHandler public static void postInit(FMLPostInitializationEvent event){
  LogHelper.debug("String_Node_Str");
  ResourceCrops.init();
  Crops.initBotaniaCrops();
  Recipes.init();
  CustomCrops.initCustomCrops();
  SeedHelper.init();
  MutationHandler.init();
  GrowthRequirements.initSoils();
  CustomCrops.initGrassSeeds();
  if (!ConfigurationHandler.disableWorldGen) {
    WorldGen.init();
  }
  proxy.initNEI();
  proxy.initSeedInfo();
  LogHelper.debug("String_Node_Str");
}
Program: 95739
Project: 95739
Buggy source:
private void drawSeedTitle(int index){
  ItemStack seed=discoveredSeeds[index];
  String title=seed.getDisplayName();
  BlockWithMeta soil=GrowthRequirements.getGrowthRequirement((ItemSeeds)seed.getItem(),seed.getItemDamage()).getSoil();
  Minecraft.getMinecraft().getTextureManager().bindTexture(RenderHelper.getItemResource(seedIcon));
  if (soil != null) {
    this.renderIconInGui(this.guiLeft + 26,this.guiTop + 11,RenderHelper.getBlockResource(soil.getBlock().getIcon(1,soil.getMeta())));
  }
  this.renderIconInGui(this.guiLeft + 25,this.guiTop + 11,RenderHelper.getItemResource(seedIcon));
  float scale=0.8F;
  while (this.fontRendererObj.getStringWidth(title) * scale > 74) {
    scale=scale - 0.1F;
  }
  GL11.glScalef(scale,scale,scale);
  this.fontRendererObj.drawString(title,(int)((this.guiLeft + 46 + 36) / scale) - this.fontRendererObj.getStringWidth(title) / 2,(int)((this.guiTop + 17) / scale),this.black);
  GL11.glScalef(1 / scale,1 / scale,1 / scale);
}

Fixed version (ground truth):
private void drawSeedTitle(int index){
  ItemStack seed=discoveredSeeds[index];
  String title=seed.getDisplayName();
  BlockWithMeta soil=GrowthRequirements.getGrowthRequirement((ItemSeeds)seed.getItem(),seed.getItemDamage()).getSoil();
  Minecraft.getMinecraft().getTextureManager().bindTexture(RenderHelper.getItemResource(seedIcon));
  if (soil != null) {
    this.renderIconInGui(this.guiLeft + 26,this.guiTop + 11,RenderHelper.getBlockResource(soil.getBlock().getIcon(1,soil.getMeta())));
  }
  GuiScreen.itemRender.renderItemIntoGUI(Minecraft.getMinecraft().fontRenderer,Minecraft.getMinecraft().getTextureManager(),seed,this.guiLeft + 25,this.guiTop + 11);
  float scale=0.8F;
  while (this.fontRendererObj.getStringWidth(title) * scale > 74) {
    scale=scale - 0.1F;
  }
  GL11.glScalef(scale,scale,scale);
  this.fontRendererObj.drawString(title,(int)((this.guiLeft + 46 + 36) / scale) - this.fontRendererObj.getStringWidth(title) / 2,(int)((this.guiTop + 17) / scale),this.black);
  GL11.glScalef(1 / scale,1 / scale,1 / scale);
}
Program: 95740
Project: 95740
Buggy source:
private void drawSeedFruits(){
  int xOffset=this.guiLeft + 30;
  int yOffset=this.guiTop + 91;
  float scale;
  for (int i=0; i < fruitIcons.length; i++) {
    if (fruitIcons[i] != null) {
      GL11.glDisable(GL11.GL_LIGHTING);
      Minecraft.getMinecraft().getTextureManager().bindTexture(textureSeedPage);
      GL11.glColor3f(1,1,1);
      drawTexturedModalRect(xOffset - 1 + i * 24,yOffset - 1,0,238,18,18);
      GL11.glEnable(GL11.GL_LIGHTING);
      ResourceLocation texture;
      if (fruits[i].getItem() instanceof ItemBlock) {
        texture=RenderHelper.getBlockResource(fruitIcons[i]);
        Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
      }
 else {
        texture=RenderHelper.getItemResource(fruitIcons[i]);
        Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
      }
      this.renderIconInGui(xOffset + i * 24,yOffset,texture);
    }
  }
  scale=0.5F;
  GL11.glScalef(scale,scale,scale);
  this.fontRendererObj.drawString(StatCollector.translateToLocal("String_Node_Str") + "String_Node_Str",(int)(this.textStart / scale),(int)((yOffset - 7) / scale),this.black);
  GL11.glScalef(1 / scale,1 / scale,1 / scale);
}

Fixed version (ground truth):
private void drawSeedFruits(){
  int xOffset=this.guiLeft + 30;
  int yOffset=this.guiTop + 91;
  float scale;
  for (int i=0; i < fruitIcons.length; i++) {
    if (fruitIcons[i] != null) {
      GL11.glDisable(GL11.GL_LIGHTING);
      Minecraft.getMinecraft().getTextureManager().bindTexture(textureSeedPage);
      GL11.glColor3f(1,1,1);
      drawTexturedModalRect(xOffset - 1 + i * 24,yOffset - 1,0,238,18,18);
      GL11.glEnable(GL11.GL_LIGHTING);
      GuiScreen.itemRender.renderItemIntoGUI(Minecraft.getMinecraft().fontRenderer,Minecraft.getMinecraft().getTextureManager(),fruits[i],xOffset + i * 24,yOffset);
    }
  }
  scale=0.5F;
  GL11.glScalef(scale,scale,scale);
  this.fontRendererObj.drawString(StatCollector.translateToLocal("String_Node_Str") + "String_Node_Str",(int)(this.textStart / scale),(int)((yOffset - 7) / scale),this.black);
  GL11.glScalef(1 / scale,1 / scale,1 / scale);
}
Program: 95741
Project: 95741
Buggy source:
@SubscribeEvent(priority=EventPriority.HIGHEST) public void onPlayerUseItemEvent(PlayerInteractEvent event){
  if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
    Block block=event.world.getBlock(event.x,event.y,event.z);
    int meta=event.world.getBlockMetadata(event.x,event.y,event.z);
    if (event.entityPlayer.getCurrentEquippedItem() != null && event.entityPlayer.getCurrentEquippedItem().stackSize > 0 && event.entityPlayer.getCurrentEquippedItem().getItem() != null && event.entityPlayer.getCurrentEquippedItem().getItem() instanceof IPlantable) {
      if (GrowthRequirements.isSoilValid(block,meta)) {
        if (ConfigurationHandler.disableVanillaFarming) {
          this.denyEvent(event,false);
        }
 else         if (event.entityPlayer.getCurrentEquippedItem().hasTagCompound()) {
          NBTTagCompound tag=(NBTTagCompound)event.entityPlayer.getCurrentEquippedItem().getTagCompound().copy();
          if (tag.hasKey(Names.NBT.growth) && tag.hasKey(Names.NBT.gain) && tag.hasKey(Names.NBT.strength)) {
            this.denyEvent(event,false);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@SubscribeEvent(priority=EventPriority.HIGHEST) public void onPlayerUseItemEvent(PlayerInteractEvent event){
  if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
    Block block=event.world.getBlock(event.x,event.y,event.z);
    int meta=event.world.getBlockMetadata(event.x,event.y,event.z);
    if (event.entityPlayer.getCurrentEquippedItem() != null && event.entityPlayer.getCurrentEquippedItem().stackSize > 0 && event.entityPlayer.getCurrentEquippedItem().getItem() != null && event.entityPlayer.getCurrentEquippedItem().getItem() instanceof IPlantable) {
      if (GrowthRequirements.isSoilValid(block,meta) || block == Blocks.farmland) {
        if (ConfigurationHandler.disableVanillaFarming) {
          this.denyEvent(event,false);
        }
 else         if (event.entityPlayer.getCurrentEquippedItem().hasTagCompound()) {
          NBTTagCompound tag=(NBTTagCompound)event.entityPlayer.getCurrentEquippedItem().getTagCompound().copy();
          if (tag.hasKey(Names.NBT.growth) && tag.hasKey(Names.NBT.gain) && tag.hasKey(Names.NBT.strength)) {
            this.denyEvent(event,false);
          }
        }
      }
    }
  }
}
Program: 95742
Project: 95742
Buggy source:
public CachedCropMutationRecipe(Mutation mutation){
  this.parent1=new PositionedStack(mutation.parent1.copy(),Constants.nei_X1,Constants.nei_Y1);
  this.parent2=new PositionedStack(mutation.parent2.copy(),Constants.nei_X2,Constants.nei_Y1);
  this.result=new PositionedStack(mutation.result.copy(),Constants.nei_X3,Constants.nei_Y1);
  GrowthRequirement growthReq=GrowthRequirements.getGrowthRequirement((ItemSeeds)result.item.getItem(),result.item.getItemDamage());
  if (growthReq.getSoil() != null) {
    Block soilBlock=growthReq.getSoil().getBlock();
    soils.add(new PositionedStack(new ItemStack(soilBlock),Constants.nei_X3,Constants.nei_Y2));
  }
 else {
    for (    BlockWithMeta blockWithMeta : GrowthRequirements.defaultSoils) {
      soils.add(new PositionedStack(new ItemStack(blockWithMeta.getBlock()),Constants.nei_X3,Constants.nei_Y2));
    }
  }
  this.requiredType=growthReq.getRequiredType();
  if (requiredType != GrowthRequirement.RequirementType.NONE) {
    requiredBlock=new PositionedStack(growthReq.requiredBlockAsItemStack(),Constants.nei_X3,Constants.nei_Y3);
  }
}

Fixed version (ground truth):
public CachedCropMutationRecipe(Mutation mutation){
  this.parent1=new PositionedStack(mutation.parent1.copy(),Constants.nei_X1,Constants.nei_Y1);
  this.parent2=new PositionedStack(mutation.parent2.copy(),Constants.nei_X2,Constants.nei_Y1);
  this.result=new PositionedStack(mutation.result.copy(),Constants.nei_X3,Constants.nei_Y1);
  GrowthRequirement growthReq=GrowthRequirements.getGrowthRequirement((ItemSeeds)result.item.getItem(),result.item.getItemDamage());
  if (growthReq.getSoil() != null) {
    soils.add(new PositionedStack(growthReq.getSoil().toStack(),Constants.nei_X3,Constants.nei_Y2));
  }
 else {
    for (    BlockWithMeta blockWithMeta : GrowthRequirements.defaultSoils) {
      soils.add(new PositionedStack(blockWithMeta.toStack(),Constants.nei_X3,Constants.nei_Y2));
    }
  }
  this.requiredType=growthReq.getRequiredType();
  if (requiredType != GrowthRequirement.RequirementType.NONE) {
    requiredBlock=new PositionedStack(growthReq.requiredBlockAsItemStack(),Constants.nei_X3,Constants.nei_Y3);
  }
}
Program: 95743
Project: 95743
Buggy source:
public static int[] getStats(TileEntityCrop[] input,boolean mutation){
  int[] output=new int[3];
  TileEntityCrop[] neighbors=getParents(input);
  int size=neighbors.length;
  int[] growth=new int[size];
  int[] gain=new int[size];
  int[] strength=new int[size];
  for (int i=0; i < size; i++) {
    growth[i]=neighbors[i].growth;
    gain[i]=neighbors[i].gain;
    strength[i]=neighbors[i].strength;
  }
  int meanGrowth=getMean(growth);
  int meanGain=getMean(gain);
  int meanStrength=getMean(strength);
  int divisor=mutation ? 1 : ConfigurationHandler.cropStatDivisor;
  output[0]=Math.max(1,getGain(meanGrowth,size) / divisor);
  output[1]=Math.max(1,getGain(meanGain,size) / divisor);
  output[2]=Math.max(1,getGain(meanStrength,size) / divisor);
  for (int i=0; i < output.length; i++) {
    output[i]=output[i] > ConfigurationHandler.cropStatCap ? ConfigurationHandler.cropStatCap : output[i];
  }
  return output;
}

Fixed version (ground truth):
public static int[] getStats(TileEntityCrop[] input,boolean mutation){
  int[] output=new int[3];
  TileEntityCrop[] neighbors=getParents(input);
  int size=neighbors.length;
  int[] growth=new int[size];
  int[] gain=new int[size];
  int[] strength=new int[size];
  for (int i=0; i < size; i++) {
    growth[i]=neighbors[i].growth;
    gain[i]=neighbors[i].gain;
    strength[i]=neighbors[i].strength;
  }
  int meanGrowth=getMean(growth);
  int meanGain=getMean(gain);
  int meanStrength=getMean(strength);
  int divisor=mutation ? ConfigurationHandler.cropStatDivisor : 1;
  output[0]=Math.max(1,getGain(meanGrowth,size) / divisor);
  output[1]=Math.max(1,getGain(meanGain,size) / divisor);
  output[2]=Math.max(1,getGain(meanStrength,size) / divisor);
  for (int i=0; i < output.length; i++) {
    output[i]=output[i] > ConfigurationHandler.cropStatCap ? ConfigurationHandler.cropStatCap : output[i];
  }
  return output;
}
Program: 95744
Project: 95744
Buggy source:
/** 
 * Tries to move an item stack form the correct tile entity to the player's inventory
 */
public void moveStackFromTileEntityToPlayer(int slotId,ItemStack stack){
  ISeedStorageControllable controllable=this.getControllable(stack);
  if (controllable != null) {
    ItemStack stackToMove=controllable.getStackInSlot(slotId);
    stackToMove.stackSize=stack.stackSize;
    stackToMove.stackTagCompound=controllable.getStackInSlot(slotId).stackTagCompound;
    if (this.mergeItemStack(stackToMove,0,PLAYER_INVENTORY_SIZE,false)) {
      if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
        NetworkWrapperAgriCraft.wrapper.sendToServer(new MessageContainerSeedStorage(stack,Minecraft.getMinecraft().thePlayer,slotId));
      }
 else {
        controllable.decrStackSize(slotId,stack.stackSize - stackToMove.stackSize);
      }
    }
 else {
      return;
    }
  }
}

Fixed version (ground truth):
/** 
 * Tries to move an item stack form the correct tile entity to the player's inventory
 */
public void moveStackFromTileEntityToPlayer(int slotId,ItemStack stack){
  ISeedStorageControllable controllable=this.getControllable(stack);
  if (controllable != null) {
    ItemStack stackToMove=controllable.getStackInSlot(slotId);
    stackToMove.stackSize=stack.stackSize;
    stackToMove.stackTagCompound=controllable.getStackInSlot(slotId).stackTagCompound;
    if (this.mergeItemStack(stackToMove,0,PLAYER_INVENTORY_SIZE,false)) {
      if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
        controllable.decrStackSize(slotId,stack.stackSize - stackToMove.stackSize);
        NetworkWrapperAgriCraft.wrapper.sendToServer(new MessageContainerSeedStorage(stack,Minecraft.getMinecraft().thePlayer,slotId));
        controllable.decrStackSize(slotId,stack.stackSize - stackToMove.stackSize);
      }
 else {
        controllable.decrStackSize(slotId,stack.stackSize - stackToMove.stackSize);
      }
    }
 else {
      return;
    }
  }
}
Program: 95745
Project: 95745
Buggy source:
public GuiSeedStorageDummy(ContainerSeedStorageDummy container,int maxVertSlots,int maxHorSlots,int sortButtonX,int sortButtonY,int setActiveSeedButtonsX,int setActiveSeedButtonsY,int seedSlotsX,int seedSlotsY){
  super(container);
  this.container=container;
  this.maxVertSlots=maxVertSlots;
  this.maxHorSlots=maxHorSlots;
  this.sortButtonX=sortButtonX;
  this.sortButtonY=sortButtonY;
  this.setActiveSeedButtonOffset_X=setActiveSeedButtonsX;
  this.setActiveSeedButtonOffset_Y=setActiveSeedButtonsY;
  this.seedSlotButtonOffset_X=seedSlotsX;
  this.seedSlotButtonOffset_Y=seedSlotsY;
}

Fixed version (ground truth):
public GuiSeedStorageDummy(ContainerSeedStorageDummy container,int maxVertSlots,int maxHorSlots,int sortButtonX,int sortButtonY,int setActiveSeedButtonsX,int setActiveSeedButtonsY,int seedSlotsX,int seedSlotsY){
  super(container);
  this.container=container;
  this.maxVertSlots=maxVertSlots;
  this.maxHorSlots=maxHorSlots;
  this.sortButtonX=sortButtonX;
  this.sortButtonY=sortButtonY;
  this.setActiveSeedButtonOffset_X=setActiveSeedButtonsX;
  this.setActiveSeedButtonOffset_Y=setActiveSeedButtonsY;
  this.seedSlotButtonOffset_X=this.guiLeft + seedSlotsX;
  this.seedSlotButtonOffset_Y=this.guiTop + seedSlotsY;
}
Program: 95747
Project: 95747
Buggy source:
public void setFluidLevel(int lvl){
  if (lvl >= 0 && lvl <= Constants.mB / 2 && lvl != this.lvl) {
    this.lvl=lvl;
  }
}

Fixed version (ground truth):
public void setFluidLevel(int lvl){
  if (lvl >= 0 && lvl <= Constants.mB / 2 && lvl != this.lvl) {
    this.lvl=lvl;
    syncToClient(false);
  }
}
Program: 95748
Project: 95748
Buggy source:
public int getId(){
  return 1000 * invId + slotId;
}

Fixed version (ground truth):
public int getId(){
  return invId >= 0 ? (1000 * invId) + slotId : slotId;
}
Program: 95749
Project: 95749
Buggy source:
@Override public void setLockedSeed(ItemSeeds seed,int meta){
  if (!this.hasLockedSeed()) {
    this.lockedSeed=seed;
    this.lockedSeedMeta=meta;
    this.markDirty();
  }
}

Fixed version (ground truth):
@Override public void setLockedSeed(ItemSeeds seed,int meta){
  if (!this.hasLockedSeed()) {
    this.lockedSeed=seed;
    this.lockedSeedMeta=meta;
    this.markForUpdate();
  }
}
Program: 95750
Project: 95750
Buggy source:
@Override public ItemStack decrStackSize(int slot,int amount){
  slot=slot % 1000;
  ItemStack stackInSlot=null;
  if (this.slots != null) {
    SeedStorageSlot slotAt=this.slots.get(slot);
    if (slotAt != null) {
      stackInSlot=slotAt.getStack(this.lockedSeed,this.lockedSeedMeta);
      if (slotAt.count <= amount) {
        this.slots.remove(slot);
      }
 else {
        slotAt.count=slotAt.count - amount;
      }
    }
  }
  this.markDirty();
  return stackInSlot;
}

Fixed version (ground truth):
@Override public ItemStack decrStackSize(int slot,int amount){
  slot=slot % 1000;
  ItemStack stackInSlot=null;
  if (this.slots != null) {
    SeedStorageSlot slotAt=this.slots.get(slot);
    if (slotAt != null) {
      stackInSlot=slotAt.getStack(this.lockedSeed,this.lockedSeedMeta);
      if (slotAt.count <= amount) {
        this.slots.remove(slot);
      }
 else {
        slotAt.count=slotAt.count - amount;
      }
    }
  }
  this.markForUpdate();
  return stackInSlot;
}
Program: 95751
Project: 95751
Buggy source:
@Override public boolean addStackToInventory(ItemStack stack){
  boolean success=false;
  if (this.hasLockedSeed() && SeedHelper.isAnalyzedSeed(stack) && this.lockedSeed == stack.getItem() && this.lockedSeedMeta == stack.getItemDamage()) {
    int lastId=0;
    for (    Map.Entry<Integer,SeedStorageSlot> entry : this.slots.entrySet()) {
      if (entry != null && entry.getValue() != null) {
        lastId=entry.getKey() > lastId ? entry.getKey() : lastId;
        if (ItemStack.areItemStackTagsEqual(entry.getValue().getStack(this.lockedSeed,this.lockedSeedMeta),stack)) {
          this.setInventorySlotContents(entry.getKey(),stack);
          success=true;
          break;
        }
      }
    }
    if (!success) {
      this.slots.put(lastId + 1,new SeedStorageSlot(stack.getTagCompound(),stack.stackSize,lastId + 1,this.getControllableID()));
      success=true;
    }
  }
  if (success) {
    this.markDirty();
  }
  return success;
}

Fixed version (ground truth):
@Override public boolean addStackToInventory(ItemStack stack){
  boolean success=false;
  if (this.hasLockedSeed() && SeedHelper.isAnalyzedSeed(stack) && this.lockedSeed == stack.getItem() && this.lockedSeedMeta == stack.getItemDamage()) {
    int lastId=0;
    for (    Map.Entry<Integer,SeedStorageSlot> entry : this.slots.entrySet()) {
      lastId=entry.getKey() > lastId ? entry.getKey() : lastId;
      if (entry.getValue() != null) {
        if (ItemStack.areItemStackTagsEqual(entry.getValue().getStack(this.lockedSeed,this.lockedSeedMeta),stack)) {
          this.setInventorySlotContents(entry.getKey(),stack);
          success=true;
          break;
        }
      }
    }
    if (!success) {
      this.slots.put(lastId + 1,new SeedStorageSlot(stack.getTagCompound(),stack.stackSize,lastId + 1,this.getControllableID()));
      success=true;
    }
  }
  if (success) {
    this.markForUpdate();
  }
  return success;
}
Program: 95752
Project: 95752
Buggy source:
@Override public void setInventorySlotContents(int slot,ItemStack inputStack){
  slot=slot % 1000;
  if (this.isItemValidForSlot(slot,inputStack)) {
    SeedStorageSlot slotAt=this.slots.get(slot);
    if (slotAt != null) {
      slotAt.count=slotAt.count + inputStack.stackSize;
    }
 else {
      this.slots.put(slot,new SeedStorageSlot(inputStack.getTagCompound(),inputStack.stackSize,slot,this.getControllableID()));
    }
    this.markDirty();
  }
}

Fixed version (ground truth):
@Override public void setInventorySlotContents(int slot,ItemStack inputStack){
  slot=slot % 1000;
  if (this.isItemValidForSlot(slot,inputStack)) {
    SeedStorageSlot slotAt=this.slots.get(slot);
    if (slotAt != null) {
      slotAt.count=slotAt.count + inputStack.stackSize;
    }
 else {
      this.slots.put(slot,new SeedStorageSlot(inputStack.getTagCompound(),inputStack.stackSize,slot,this.getControllableID()));
    }
    this.markForUpdate();
  }
}
Program: 95753
Project: 95753
Buggy source:
@Override public void addDebugInfo(List<String> list){
  String info=this.lockedSeed == null ? "String_Node_Str" : this.getLockedSeed().getDisplayName();
  list.add("String_Node_Str" + info);
  list.add("String_Node_Str" + this.slots.size());
}

Fixed version (ground truth):
@Override public void addDebugInfo(List<String> list){
  String info=this.lockedSeed == null ? "String_Node_Str" : this.getLockedSeed().getDisplayName();
  int size=this.slots == null ? 0 : this.slots.size();
  list.add("String_Node_Str" + info);
  list.add("String_Node_Str" + size);
}
Program: 95755
Project: 95755
Buggy source:
protected void connectWater(TileEntityChannel channel,Tessellator tessellator,char axis,int direction,float y,IIcon icon){
  if (axis == 'x' || axis == 'z') {
    if (channel.hasNeighbour(axis,direction)) {
      boolean x=axis == 'x';
      TileEntityCustomWood te=(TileEntityCustomWood)channel.getWorldObj().getTileEntity(channel.xCoord + (x ? direction : 0),channel.yCoord,channel.zCoord + (x ? 0 : direction));
      float y2;
      if (te instanceof TileEntityChannel) {
        if (te instanceof TileEntityValve && ((TileEntityValve)te).isPowered()) {
          y2=y;
        }
 else {
          y2=(y + ((TileEntityChannel)te).getDiscreteScaledFluidHeight()) / 2;
        }
      }
 else {
        float lvl=((TileEntityTank)te).getFluidY() - 16 * ((TileEntityTank)te).getYPosition();
        y2=lvl > 12 ? 12 : lvl < 5 ? (5 - 0.0001F) : lvl;
      }
      this.drawWaterEdge(tessellator,x,direction,y,y2,icon);
    }
  }
}

Fixed version (ground truth):
protected void connectWater(TileEntityChannel channel,Tessellator tessellator,char axis,int direction,float y,IIcon icon){
  if (axis == 'x' || axis == 'z') {
    if (channel.hasNeighbour(axis,direction)) {
      boolean x=axis == 'x';
      TileEntityCustomWood te=(TileEntityCustomWood)channel.getWorldObj().getTileEntity(channel.xCoord + (x ? direction : 0),channel.yCoord,channel.zCoord + (x ? 0 : direction));
      float y2;
      if (te instanceof TileEntityChannel) {
        if (te instanceof TileEntityValve && ((TileEntityValve)te).isPowered()) {
          y2=y;
        }
 else {
          y2=(y + ((TileEntityChannel)te).getDiscreteScaledFluidHeight()) / 2;
        }
      }
 else {
        float lvl=((TileEntityTank)te).getScaledDiscreteFluidY() - 16 * ((TileEntityTank)te).getYPosition();
        y2=lvl > 12 ? 12 : lvl < 5 ? (5 - 0.0001F) : lvl;
      }
      this.drawWaterEdge(tessellator,x,direction,y,y2,icon);
    }
  }
}
Program: 95756
Project: 95756
Buggy source:
@Override public boolean renderWorldBlock(IBlockAccess world,int x,int y,int z,Block block,int modelId,RenderBlocks renderer){
  TileEntity tileEntity=world.getTileEntity(x,y,z);
  Tessellator tessellator=Tessellator.instance;
  tessellator.addTranslation(x,y,z);
  tessellator.setColorRGBA_F(1,1,1,1);
  if (tileEntity instanceof TileEntityTank) {
    TileEntityTank tank=(TileEntityTank)tileEntity;
    if (tank.getBlockMetadata() == 0) {
      this.drawWoodTank(tank,tessellator);
      if (tank.getFluidLevel() > 0) {
        this.drawWater(tank,tessellator);
      }
    }
 else     if (tank.getBlockMetadata() == 1) {
      this.drawIronTank(tank,tessellator);
    }
  }
  renderer.clearOverrideBlockTexture();
  tessellator.addTranslation(-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 tileEntity=world.getTileEntity(x,y,z);
  Tessellator tessellator=Tessellator.instance;
  tessellator.addTranslation(x,y,z);
  tessellator.setColorRGBA_F(1,1,1,1);
  if (tileEntity instanceof TileEntityTank) {
    TileEntityTank tank=(TileEntityTank)tileEntity;
    if (tank.getBlockMetadata() == 0) {
      this.drawWoodTank(tank,tessellator);
      if (tank.getScaledDiscreteFluidLevel() > 0) {
        this.drawWater(tank,tessellator);
      }
    }
 else     if (tank.getBlockMetadata() == 1) {
      this.drawIronTank(tank,tessellator);
    }
  }
  renderer.clearOverrideBlockTexture();
  tessellator.addTranslation(-x,-y,-z);
  return true;
}
Program: 95757
Project: 95757
Buggy source:
private void drawWater(TileEntityTank tank,Tessellator tessellator){
  if (tank.getYPosition() == 0) {
    float y=tank.getFluidY() - 0.01F;
    IIcon icon=Blocks.water.getIcon(1,0);
    int l=Blocks.water.colorMultiplier(tank.getWorldObj(),tank.xCoord,tank.yCoord,tank.zCoord);
    float f=(float)(l >> 16 & 255) / 255.0F;
    float f1=(float)(l >> 8 & 255) / 255.0F;
    float f2=(float)(l & 255) / 255.0F;
    float f4=1.0F;
    tessellator.setBrightness(Blocks.water.getMixedBrightnessForBlock(tank.getWorldObj(),tank.xCoord,tank.yCoord,tank.zCoord));
    tessellator.setColorRGBA_F(f4 * f,f4 * f1,f4 * f2,0.8F);
    RenderHelper.addScaledVertexWithUV(tessellator,0,y,0,0,0,icon);
    RenderHelper.addScaledVertexWithUV(tessellator,0,y,16,0,16,icon);
    RenderHelper.addScaledVertexWithUV(tessellator,16,y,16,16,16,icon);
    RenderHelper.addScaledVertexWithUV(tessellator,16,y,0,16,0,icon);
  }
}

Fixed version (ground truth):
private void drawWater(TileEntityTank tank,Tessellator tessellator){
  if (tank.getYPosition() == 0) {
    float y=tank.getScaledDiscreteFluidY() - 0.01F;
    IIcon icon=Blocks.water.getIcon(1,0);
    int l=Blocks.water.colorMultiplier(tank.getWorldObj(),tank.xCoord,tank.yCoord,tank.zCoord);
    float f=(float)(l >> 16 & 255) / 255.0F;
    float f1=(float)(l >> 8 & 255) / 255.0F;
    float f2=(float)(l & 255) / 255.0F;
    float f4=1.0F;
    tessellator.setBrightness(Blocks.water.getMixedBrightnessForBlock(tank.getWorldObj(),tank.xCoord,tank.yCoord,tank.zCoord));
    tessellator.setColorRGBA_F(f4 * f,f4 * f1,f4 * f2,0.8F);
    RenderHelper.addScaledVertexWithUV(tessellator,0,y,0,0,0,icon);
    RenderHelper.addScaledVertexWithUV(tessellator,0,y,16,0,16,icon);
    RenderHelper.addScaledVertexWithUV(tessellator,16,y,16,16,16,icon);
    RenderHelper.addScaledVertexWithUV(tessellator,16,y,0,16,0,icon);
  }
}
Program: 95759
Project: 95759
Buggy source:
public void setPlant(int growth,int gain,int strength,boolean analyzed,IPlantable seed,int seedMeta){
  if ((!this.crossCrop) && (!this.hasPlant())) {
    this.growth=growth;
    this.gain=gain;
    this.strength=strength;
    this.seed=seed;
    this.analyzed=analyzed;
    this.seedMeta=seedMeta;
    this.worldObj.setBlockMetadataWithNotify(this.xCoord,this.yCoord,this.zCoord,0,3);
    this.markDirty();
  }
}

Fixed version (ground truth):
public void setPlant(int growth,int gain,int strength,boolean analyzed,IPlantable seed,int seedMeta){
  if ((!this.crossCrop) && (!this.hasPlant())) {
    this.growth=growth;
    this.gain=gain;
    this.strength=strength;
    this.seed=seed;
    this.analyzed=analyzed;
    this.seedMeta=seedMeta;
    this.worldObj.setBlockMetadataWithNotify(this.xCoord,this.yCoord,this.zCoord,0,3);
    this.markDirtyAndMarkForUpdate();
  }
}
Program: 95760
Project: 95760
Buggy source:
public void clearPlant(){
  if (!this.crossCrop) {
    this.growth=0;
    this.gain=0;
    this.strength=0;
    this.seed=null;
    this.seedMeta=0;
    this.analyzed=false;
    this.weed=false;
    this.worldObj.setBlockMetadataWithNotify(this.xCoord,this.yCoord,this.zCoord,0,3);
    this.markDirty();
  }
}

Fixed version (ground truth):
public void clearPlant(){
  if (!this.crossCrop) {
    this.growth=0;
    this.gain=0;
    this.strength=0;
    this.seed=null;
    this.seedMeta=0;
    this.analyzed=false;
    this.weed=false;
    this.worldObj.setBlockMetadataWithNotify(this.xCoord,this.yCoord,this.zCoord,0,3);
    this.markDirtyAndMarkForUpdate();
  }
}
Program: 95761
Project: 95761
Buggy source:
public void spawnWeed(){
  this.crossCrop=false;
  this.clearPlant();
  this.weed=true;
  this.markDirty();
}

Fixed version (ground truth):
public void spawnWeed(){
  this.crossCrop=false;
  this.clearPlant();
  this.weed=true;
  this.markDirtyAndMarkForUpdate();
}
Program: 95762
Project: 95762
Buggy source:
public void clearWeed(){
  this.weed=false;
  this.worldObj.setBlockMetadataWithNotify(this.xCoord,this.yCoord,this.zCoord,0,2);
  this.markDirty();
}

Fixed version (ground truth):
public void clearWeed(){
  this.weed=false;
  this.worldObj.setBlockMetadataWithNotify(this.xCoord,this.yCoord,this.zCoord,0,2);
  this.markDirtyAndMarkForUpdate();
}