nus-yam/ex-repair huggingface dataset:
Program: 95653
Project: 95653
Buggy source:
@Override public boolean applySeeds(World world,int x,int y,int z,ItemStack seed){
  if (!world.isRemote) {
    if (SeedHelper.isValidSeedStack(seed)) {
      TileEntity te=world.getTileEntity(x,y,z);
      if (te instanceof TileEntityCrop) {
        TileEntityCrop crop=(TileEntityCrop)te;
        if (crop.crossCrop || crop.hasPlant() || !GrowthRequirements.getGrowthRequirement((ItemSeeds)seed.getItem(),seed.getItemDamage()).canGrow(world,x,y,z)) {
          return false;
        }
        if (seed.stackTagCompound != null && seed.stackTagCompound.hasKey(Names.NBT.growth)) {
          crop.setPlant(seed.stackTagCompound.getInteger(Names.NBT.growth),seed.stackTagCompound.getInteger(Names.NBT.gain),seed.stackTagCompound.getInteger(Names.NBT.strength),seed.stackTagCompound.getBoolean(Names.NBT.analyzed),(ItemSeeds)seed.getItem(),seed.getItemDamage());
        }
 else {
          crop.setPlant(Constants.defaultGrowth,Constants.defaultGain,Constants.defaultStrength,false,(ItemSeeds)seed.getItem(),seed.getItemDamage());
        }
        crop.markForUpdate();
        seed.stackSize--;
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean applySeeds(World world,int x,int y,int z,ItemStack seed){
  if (!world.isRemote) {
    if (CropPlantHandler.isValidSeed(seed)) {
      TileEntity te=world.getTileEntity(x,y,z);
      if (te instanceof TileEntityCrop) {
        TileEntityCrop crop=(TileEntityCrop)te;
        if (crop.isCrossCrop() || crop.hasPlant() || !GrowthRequirements.getGrowthRequirement((ItemSeeds)seed.getItem(),seed.getItemDamage()).canGrow(world,x,y,z)) {
          return false;
        }
        if (seed.stackTagCompound != null && seed.stackTagCompound.hasKey(Names.NBT.growth)) {
          crop.setPlant(seed.stackTagCompound.getInteger(Names.NBT.growth),seed.stackTagCompound.getInteger(Names.NBT.gain),seed.stackTagCompound.getInteger(Names.NBT.strength),seed.stackTagCompound.getBoolean(Names.NBT.analyzed),(ItemSeeds)seed.getItem(),seed.getItemDamage());
        }
 else {
          crop.setPlant(Constants.defaultGrowth,Constants.defaultGain,Constants.defaultStrength,false,(ItemSeeds)seed.getItem(),seed.getItemDamage());
        }
        crop.markForUpdate();
        seed.stackSize--;
        return true;
      }
    }
  }
  return false;
}
Program: 95654
Project: 95654
Buggy source:
@Override public SeedRequirementStatus canApplySeeds(World world,int x,int y,int z,ItemStack seed){
  if (SeedHelper.isValidSeedStack(seed)) {
    TileEntity te=world.getTileEntity(x,y,z);
    if (te instanceof TileEntityCrop) {
      TileEntityCrop crop=(TileEntityCrop)te;
      if (crop.crossCrop || crop.hasPlant()) {
        return SeedRequirementStatus.BAD_LOCATION;
      }
      GrowthRequirement growthRequirement=GrowthRequirements.getGrowthRequirement((ItemSeeds)seed.getItem(),seed.getItemDamage());
      if (!growthRequirement.isValidSoil(world,x,y - 1,z)) {
        return SeedRequirementStatus.WRONG_SOIL;
      }
      if (!growthRequirement.isBaseBlockPresent(world,x,y,z)) {
        return SeedRequirementStatus.MISSING_REQUIREMENTS;
      }
      if (!growthRequirement.canGrow(world,x,y,z)) {
        return SeedRequirementStatus.MISSING_REQUIREMENTS;
      }
      return SeedRequirementStatus.CAN_APPLY;
    }
 else {
      return SeedRequirementStatus.BAD_LOCATION;
    }
  }
 else {
    return SeedRequirementStatus.BAD_SEED;
  }
}

Fixed version (ground truth):
@Override public SeedRequirementStatus canApplySeeds(World world,int x,int y,int z,ItemStack seed){
  if (CropPlantHandler.isValidSeed(seed)) {
    TileEntity te=world.getTileEntity(x,y,z);
    if (te instanceof TileEntityCrop) {
      TileEntityCrop crop=(TileEntityCrop)te;
      if (crop.isCrossCrop() || crop.hasPlant()) {
        return SeedRequirementStatus.BAD_LOCATION;
      }
      GrowthRequirement growthRequirement=GrowthRequirements.getGrowthRequirement((ItemSeeds)seed.getItem(),seed.getItemDamage());
      if (!growthRequirement.isValidSoil(world,x,y - 1,z)) {
        return SeedRequirementStatus.WRONG_SOIL;
      }
      if (!growthRequirement.isBaseBlockPresent(world,x,y,z)) {
        return SeedRequirementStatus.MISSING_REQUIREMENTS;
      }
      if (!growthRequirement.canGrow(world,x,y,z)) {
        return SeedRequirementStatus.MISSING_REQUIREMENTS;
      }
      return SeedRequirementStatus.CAN_APPLY;
    }
 else {
      return SeedRequirementStatus.BAD_LOCATION;
    }
  }
 else {
    return SeedRequirementStatus.BAD_SEED;
  }
}
Program: 95655
Project: 95655
Buggy source:
@Override public boolean isWeeds(World world,int x,int y,int z){
  if (!ConfigurationHandler.enableWeeds) {
    return false;
  }
  TileEntity te=world.getTileEntity(x,y,z);
  if (te instanceof TileEntityCrop) {
    TileEntityCrop crop=(TileEntityCrop)te;
    return crop.weed;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isWeeds(World world,int x,int y,int z){
  if (!ConfigurationHandler.enableWeeds) {
    return false;
  }
  TileEntity te=world.getTileEntity(x,y,z);
  if (te instanceof TileEntityCrop) {
    TileEntityCrop crop=(TileEntityCrop)te;
    return crop.hasWeed();
  }
  return false;
}
Program: 95656
Project: 95656
Buggy source:
@Override public boolean isValidFertilizer(World world,int x,int y,int z,ItemStack fertilizer){
  if (fertilizer == null || fertilizer.getItem() == null) {
    return false;
  }
  TileEntity te=world.getTileEntity(x,y,z);
  if (te instanceof TileEntityCrop) {
    TileEntityCrop crop=(TileEntityCrop)te;
    if (fertilizer.getItem() == net.minecraft.init.Items.dye && fertilizer.getItemDamage() == 15) {
      return (crop.crossCrop && ConfigurationHandler.bonemealMutation) || (crop.hasPlant() && !crop.isMature() && crop.isFertile()&& SeedHelper.getSeedTier(crop.seed,crop.seedMeta) < 4);
    }
 else     if (ModIntegration.LoadedMods.magicalCrops && ConfigurationHandler.integration_allowMagicFertiliser && fertilizer.getItem() == Item.itemRegistry.getObject("String_Node_Str")) {
      return crop.hasPlant() && !crop.isMature() && crop.isFertile();
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isValidFertilizer(World world,int x,int y,int z,ItemStack fertilizer){
  if (fertilizer == null || fertilizer.getItem() == null) {
    return false;
  }
  TileEntity te=world.getTileEntity(x,y,z);
  if (te instanceof TileEntityCrop) {
    TileEntityCrop crop=(TileEntityCrop)te;
    if (fertilizer.getItem() == net.minecraft.init.Items.dye && fertilizer.getItemDamage() == 15) {
      return (crop.isCrossCrop() && ConfigurationHandler.bonemealMutation) || (crop.hasPlant() && !crop.isMature() && crop.isFertile()&& CropPlantHandler.getPlantFromStack(crop.getSeedStack()).getTier() < 4);
    }
 else     if (ModIntegration.LoadedMods.magicalCrops && ConfigurationHandler.integration_allowMagicFertiliser && fertilizer.getItem() == Item.itemRegistry.getObject("String_Node_Str")) {
      return crop.hasPlant() && !crop.isMature() && crop.isFertile();
    }
  }
  return false;
}
Program: 95657
Project: 95657
Buggy source:
/** 
 * @return true, if the light level is between the allowed values 
 */
public boolean isBrightnessGood(int lvl){
  return lvl < this.maxBrightness && lvl >= this.minBrightness;
}

Fixed version (ground truth):
/** 
 * @return true, if the light level is between the allowed values 
 */
public boolean isBrightnessGood(World world,int x,int y,int z){
  int lvl=world.getBlock(x,y,z).getLightValue(world,x,y,z);
  return lvl < this.maxBrightness && lvl >= this.minBrightness;
}
Program: 95658
Project: 95658
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,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,x,y,z) && this.isBaseBlockPresent(world,x,y,z);
}
Program: 95660
Project: 95660
Buggy source:
@SideOnly(Side.CLIENT) private void renderLiquidSpray(){
  this.angle=(this.angle + 5F) % 360;
  for (int i=0; i < 4; i++) {
    float alpha=(this.angle + 90 * i) * ((float)Math.PI) / 180;
    double xOffset=(4 * Constants.unit) * Math.cos(alpha);
    double zOffset=(4 * Constants.unit) * Math.sin(alpha);
    float radius=0.3F;
    for (int j=0; j <= 4; j++) {
      float beta=-j * ((float)Math.PI) / (8.0F);
      Vec3 vector=Vec3.createVectorHelper(radius * Math.cos(alpha),radius * Math.sin(beta),radius * Math.sin(alpha));
      this.spawnLiquidSpray(xOffset * (4 - j) / 4,zOffset * (4 - j) / 4,vector);
    }
  }
}

Fixed version (ground truth):
@SideOnly(Side.CLIENT) private void renderLiquidSpray(){
  this.angle=(this.angle + 5F) % 360;
  int particleSetting=Minecraft.getMinecraft().gameSettings.particleSetting;
  counter=(counter + 1) % (particleSetting + 1);
  if (counter == 0) {
    for (int i=0; i < 4; i++) {
      float alpha=(this.angle + 90 * i) * ((float)Math.PI) / 180;
      double xOffset=(4 * Constants.unit) * Math.cos(alpha);
      double zOffset=(4 * Constants.unit) * Math.sin(alpha);
      float radius=0.3F;
      for (int j=0; j <= 4; j++) {
        float beta=-j * ((float)Math.PI) / (8.0F);
        Vec3 vector=Vec3.createVectorHelper(radius * Math.cos(alpha),radius * Math.sin(beta),radius * Math.sin(alpha));
        this.spawnLiquidSpray(xOffset * (4 - j) / 4,zOffset * (4 - j) / 4,vector);
      }
    }
  }
}
Program: 95661
Project: 95661
Buggy source:
public static ArrayList<ItemStack> getPlantFruits(ItemSeeds seed,World world,int x,int y,int z,int gain,int meta){
  int nr=(int)(Math.ceil((gain + 0.00) / 3));
  Block plant=getPlant(seed);
  ArrayList<ItemStack> items=new ArrayList<ItemStack>();
  if (plant == Blocks.nether_wart) {
    LogHelper.debug("String_Node_Str");
    items.add(new ItemStack(seed,nr,0));
  }
 else   if (plant instanceof BlockModPlant) {
    LogHelper.debug("String_Node_Str");
    items.addAll(((BlockModPlant)plant).getFruit(nr,world.rand));
  }
 else   if (ModIntegration.LoadedMods.natura && getPlantDomain(seed).equalsIgnoreCase("String_Node_Str")) {
    LogHelper.debug("String_Node_Str");
    items.add(new ItemStack(NContent.plantItem,nr,meta * 3));
  }
 else   if (ModIntegration.LoadedMods.chococraft && seed instanceof ItemGysahlSeeds) {
    LogHelper.debug("String_Node_Str");
    items.add(ChococraftHelper.getFruit(gain,nr));
  }
 else   if (ModIntegration.LoadedMods.psychedelicraft && plant instanceof IvTilledFieldPlant) {
    LogHelper.debug("String_Node_Str");
  }
 else {
    LogHelper.debug("String_Node_Str");
    addFruitsFromOreDict(items,seed,meta,world.rand,nr);
  }
  if (items.size() == 0) {
    LogHelper.debug("String_Node_Str");
    int harvestMeta=7;
    if (ModIntegration.LoadedMods.plantMegaPack && getPlantDomain(seed).equalsIgnoreCase("String_Node_Str")) {
      harvestMeta=PlantMegaPackHelper.getTextureIndex(seed,harvestMeta);
    }
    addFruitsFromPlant(items,plant,world,x,y,z,harvestMeta,nr);
  }
  return items;
}

Fixed version (ground truth):
public static ArrayList<ItemStack> getPlantFruits(ItemSeeds seed,World world,int x,int y,int z,int gain,int meta){
  int nr=(int)(Math.ceil((gain + 0.00) / 3));
  Block plant=getPlant(seed);
  ArrayList<ItemStack> items=new ArrayList<ItemStack>();
  if (plant == Blocks.nether_wart) {
    LogHelper.debug("String_Node_Str");
    items.add(new ItemStack(seed,nr,0));
  }
 else   if (plant instanceof BlockModPlant) {
    LogHelper.debug("String_Node_Str");
    items.addAll(((BlockModPlant)plant).getFruit(nr,world.rand));
  }
 else   if (ModIntegration.LoadedMods.natura && getPlantDomain(seed).equalsIgnoreCase("String_Node_Str")) {
    LogHelper.debug("String_Node_Str");
    items.add(new ItemStack(NContent.plantItem,nr,meta * 3));
  }
 else   if (ModIntegration.LoadedMods.chococraft && seed instanceof ItemGysahlSeeds) {
    LogHelper.debug("String_Node_Str");
    items.add(ChococraftHelper.getFruit(gain,nr));
  }
 else {
    LogHelper.debug("String_Node_Str");
    addFruitsFromOreDict(items,seed,meta,world.rand,nr);
  }
  if (items.size() == 0) {
    LogHelper.debug("String_Node_Str");
    int harvestMeta=7;
    if (ModIntegration.LoadedMods.plantMegaPack && getPlantDomain(seed).equalsIgnoreCase("String_Node_Str")) {
      harvestMeta=PlantMegaPackHelper.getTextureIndex(seed,harvestMeta);
    }
    addFruitsFromPlant(items,plant,world,x,y,z,harvestMeta,nr);
  }
  return items;
}
Program: 95662
Project: 95662
Buggy source:
public static void init(){
  try {
    MapGenStructureIO.func_143031_a(StructureGreenhouse.class,Reference.MOD_ID + "String_Node_Str");
  }
 catch (  Exception exception) {
    LogHelper.info("String_Node_Str");
  }
  VillagerRegistry.instance().registerVillageCreationHandler(new VillageCreationHandler.GreenhouseHandler());
  if (!ConfigurationHandler.disableIrrigation) {
    try {
      MapGenStructureIO.func_143031_a(StructureGreenhouseIrrigated.class,Reference.MOD_ID + "String_Node_Str");
    }
 catch (    Exception exception) {
      LogHelper.info("String_Node_Str");
    }
    VillagerRegistry.instance().registerVillageCreationHandler(new VillageCreationHandler.GreenhouseIrrigatedHandler());
  }
  if (ConfigurationHandler.villagerEnabled) {
    VillagerRegistry.instance().registerVillagerId(ConfigurationHandler.villagerID);
    VillagerRegistry.instance().registerVillageTradeHandler(ConfigurationHandler.villagerID,new VillagerTradeHandler());
  }
}

Fixed version (ground truth):
public static void init(){
  if (ConfigurationHandler.villagerEnabled) {
    VillagerRegistry.instance().registerVillagerId(ConfigurationHandler.villagerID);
    VillagerRegistry.instance().registerVillageTradeHandler(ConfigurationHandler.villagerID,new VillagerTradeHandler());
  }
  VillagerRegistry.instance().registerVillageCreationHandler(new VillageCreationHandler.GreenhouseHandler());
  try {
    MapGenStructureIO.func_143031_a(StructureGreenhouse.class,Reference.MOD_ID + "String_Node_Str");
  }
 catch (  Exception exception) {
    LogHelper.info("String_Node_Str");
  }
  VillagerRegistry.instance().registerVillageCreationHandler(new VillageCreationHandler.GreenhouseIrrigatedHandler());
  if (!ConfigurationHandler.disableIrrigation) {
    try {
      MapGenStructureIO.func_143031_a(StructureGreenhouseIrrigated.class,Reference.MOD_ID + "String_Node_Str");
    }
 catch (    Exception exception) {
      LogHelper.info("String_Node_Str");
    }
  }
}
Program: 95663
Project: 95663
Buggy source:
public static ArrayList<ItemStack> getAllPlantFruits(ItemSeeds seed,World world,int x,int y,int z,int gain,int meta){
  Block plant=getPlant(seed);
  ArrayList<ItemStack> items=new ArrayList<ItemStack>();
  if (plant instanceof BlockModPlant) {
    items.addAll(((BlockModPlant)plant).getFruits());
  }
 else   if (ModIntegration.LoadedMods.chococraft && seed instanceof ItemGysahlSeeds) {
    items.addAll(ChococraftHelper.getFruits());
  }
 else {
    items=(ArrayList<ItemStack>)getFruitsFromOreDict(seed,meta);
  }
  if (items.size() == 0) {
    items=getPlantFruits(seed,world,x,y,z,gain,meta);
  }
  return items;
}

Fixed version (ground truth):
public static ArrayList<ItemStack> getAllPlantFruits(ItemSeeds seed,World world,int x,int y,int z,int gain,int meta){
  Block plant=getPlant(seed);
  ArrayList<ItemStack> items=new ArrayList<ItemStack>();
  if (plant instanceof BlockModPlant) {
    items.addAll(((BlockModPlant)plant).getFruits());
  }
 else   if (ModIntegration.LoadedMods.chococraft && seed instanceof ItemGysahlSeeds) {
    items.addAll(ChococraftHelper.getFruits());
  }
 else {
    items=(ArrayList<ItemStack>)getFruitsFromOreDict(seed,meta);
  }
  if (items == null || items.size() == 0) {
    items=getPlantFruits(seed,world,x,y,z,gain,meta);
  }
  return items;
}
Program: 95664
Project: 95664
Buggy source:
public BlockModPlant(Block soil,Block base,int baseMeta,Item fruit,int fruitMeta,int tier,int renderType,boolean isCustom){
  super();
  GrowthRequirement.Builder builder=new GrowthRequirement.Builder();
  if (base != null)   builder.requiredBlock(new BlockWithMeta(base,baseMeta),GrowthRequirement.RequirementType.BELOW,true);
  if (soil == null || soil == Blocks.farmland) {
    growthRequirement=builder.build();
  }
 else {
    growthRequirement=builder.soil(new BlockWithMeta(soil)).build();
  }
  this.products.addProduce(new ItemStack(fruit,1,fruitMeta));
  this.tier=tier;
  this.setTickRandomly(true);
  this.useNeighborBrightness=true;
  this.renderType=renderType == 1 ? renderType : 6;
  this.isEditable=isCustom;
}

Fixed version (ground truth):
public BlockModPlant(Block soil,Block base,int baseMeta,Item fruit,int fruitMeta,int tier,int renderType,boolean isCustom){
  super();
  GrowthRequirement.Builder builder=new GrowthRequirement.Builder();
  if (base != null) {
    builder.requiredBlock(new BlockWithMeta(base,baseMeta),GrowthRequirement.RequirementType.BELOW,true);
  }
  if (soil == null || soil == Blocks.farmland) {
    growthRequirement=builder.build();
  }
 else {
    growthRequirement=builder.soil(new BlockWithMeta(soil)).build();
  }
  this.products.addProduce(new ItemStack(fruit,1,fruitMeta));
  this.tier=tier;
  this.setTickRandomly(true);
  this.useNeighborBrightness=true;
  this.renderType=renderType == 1 ? renderType : 6;
  this.isEditable=isCustom;
}
Program: 95665
Project: 95665
Buggy source:
@Override public void postHarvest(World world,int x,int y,int z){
  world.setBlockMetadataWithNotify(x,y,z,2,3);
  ((TileEntityCrop)world.getTileEntity(x,y,z)).markForUpdate();
}

Fixed version (ground truth):
@Override public void postHarvest(World world,int x,int y,int z){
  Block block=world.getBlock(x,y,z);
  if (block == null || !(block instanceof BlockCrop)) {
    return;
  }
  TileEntity te=world.getTileEntity(x,y,z);
  if (te == null || !(te instanceof TileEntityCrop)) {
    return;
  }
  world.setBlockMetadataWithNotify(x,y,z,2,3);
  ((TileEntityCrop)te).markForUpdate();
}
Program: 95666
Project: 95666
Buggy source:
@Override public List<ItemStack> getDrops(World world,Random rand,Map<String,Boolean> harvesterSettings,int x,int y,int z){
  ArrayList<ItemStack> items=new ArrayList<ItemStack>();
  if (world.getTileEntity(x,y,z) != null && world.getTileEntity(x,y,z) instanceof TileEntityCrop) {
    TileEntityCrop crop=(TileEntityCrop)world.getTileEntity(x,y,z);
    if (crop.hasPlant() && crop.isMature()) {
      items.addAll(SeedHelper.getPlantFruits((ItemSeeds)crop.seed,crop.getWorldObj(),crop.xCoord,crop.yCoord,crop.zCoord,crop.gain,crop.seedMeta));
    }
  }
  return items;
}

Fixed version (ground truth):
@Override public List<ItemStack> getDrops(World world,Random rand,Map<String,Boolean> harvesterSettings,int x,int y,int z){
  ArrayList<ItemStack> items=new ArrayList<ItemStack>();
  if (world.getTileEntity(x,y,z) != null && world.getTileEntity(x,y,z) instanceof TileEntityCrop) {
    TileEntityCrop crop=(TileEntityCrop)world.getTileEntity(x,y,z);
    if (crop.hasPlant() && crop.isMature()) {
      items.addAll(SeedHelper.getPlantFruits(crop.seed,crop.getWorldObj(),crop.xCoord,crop.yCoord,crop.zCoord,crop.gain,crop.seedMeta));
    }
  }
  return items;
}
Program: 95667
Project: 95667
Buggy source:
/** 
 * Sets the required soil 
 */
public Builder soil(BlockWithMeta block){
  GrowthRequirements.soils.add(block);
  growthRequirement.soil=block;
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the required soil 
 */
public Builder soil(BlockWithMeta block){
  GrowthRequirements.addSoil(block);
  growthRequirement.soil=block;
  return this;
}
Program: 95668
Project: 95668
Buggy source:
public void setSoil(BlockWithMeta soil){
  this.soil=soil;
  GrowthRequirements.soils.add(soil);
}

Fixed version (ground truth):
public void setSoil(BlockWithMeta soil){
  this.soil=soil;
  GrowthRequirements.addSoil(soil);
}
Program: 95669
Project: 95669
Buggy source:
public static void addAllToSoilWhitelist(Collection<? extends BlockWithMeta> list){
  defaultSoils.addAll(list);
}

Fixed version (ground truth):
public static void addAllToSoilWhitelist(Collection<? extends BlockWithMeta> list){
  for (  BlockWithMeta block : list) {
    addDefaultSoil(block);
  }
}
Program: 95670
Project: 95670
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));
  }
  if (ModIntegration.LoadedMods.gardenStuff) {
    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(){
  addDefaultSoil(new BlockWithMeta(Blocks.farmland));
  if (ModIntegration.LoadedMods.forestry) {
    addDefaultSoil(new BlockWithMeta((Block)Block.blockRegistry.getObject("String_Node_Str"),0));
  }
  if (ModIntegration.LoadedMods.gardenStuff) {
    addDefaultSoil(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) {
      addDefaultSoil(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: 95671
Project: 95671
Buggy source:
public BlockWithMeta(Block block,int meta){
  this.block=block;
  this.meta=meta;
}

Fixed version (ground truth):
public BlockWithMeta(Block block,int meta,boolean fuzzy){
  this.block=block;
  this.meta=meta;
  this.ignoreMeta=fuzzy;
}
Program: 95672
Project: 95672
Buggy source:
@Override public boolean equals(Object obj){
  if (obj == null)   return false;
  if (obj instanceof BlockWithMeta) {
    BlockWithMeta block=(BlockWithMeta)obj;
    return block.block == this.block && block.meta == this.meta;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj == null) {
    return false;
  }
  if (obj instanceof BlockWithMeta) {
    BlockWithMeta block=(BlockWithMeta)obj;
    if (this.ignoreMeta || block.ignoreMeta) {
      return block.block == this.block;
    }
 else {
      return block.block == this.block && block.meta == this.meta;
    }
  }
  return false;
}
Program: 95676
Project: 95676
Buggy source:
public static int plantIconIndex(ItemSeeds seed,int seedMeta,int growthMeta){
  if (ModIntegration.LoadedMods.natura && SeedHelper.getPlantDomain(seed).equalsIgnoreCase("String_Node_Str")) {
    return NaturaHelper.getTextureIndex(growthMeta,seedMeta);
  }
 else   if (ModIntegration.LoadedMods.plantMegaPack && SeedHelper.getPlantDomain(seed).equalsIgnoreCase("String_Node_Str")) {
    return PlantMegaPackHelper.getTextureIndex(seed,growthMeta);
  }
 else   if (ModIntegration.LoadedMods.chococraft && seed instanceof ItemGysahlSeeds) {
    return ChococraftHelper.transformMeta(growthMeta);
  }
 else   if (seed == Items.nether_wart) {
    return (int)Math.ceil(((float)growthMeta - 2) / 2);
  }
 else {
    return growthMeta;
  }
}

Fixed version (ground truth):
public static int plantIconIndex(ItemSeeds seed,int seedMeta,int growthMeta){
  Block plant=null;
  try {
    plant=seed.getPlant(null,0,0,0);
  }
 catch (  Exception e) {
    LogHelper.debug("String_Node_Str");
  }
  if (seed instanceof ItemModSeed) {
    return growthMeta;
  }
 else   if (ModIntegration.LoadedMods.magicalCrops && plant != null && plant instanceof BlockMagicalCrops) {
    return growthMeta;
  }
 else   if (ModIntegration.LoadedMods.natura && SeedHelper.getPlantDomain(seed).equalsIgnoreCase("String_Node_Str")) {
    return NaturaHelper.getTextureIndex(growthMeta,seedMeta);
  }
 else   if (ModIntegration.LoadedMods.plantMegaPack && SeedHelper.getPlantDomain(seed).equalsIgnoreCase("String_Node_Str")) {
    return PlantMegaPackHelper.getTextureIndex(seed,growthMeta);
  }
 else   if (ModIntegration.LoadedMods.chococraft && seed instanceof ItemGysahlSeeds) {
    return ChococraftHelper.transformMeta(growthMeta);
  }
 else   if (ModIntegration.LoadedMods.psychedelicraft && plant != null && plant instanceof IvTilledFieldPlant) {
    return PsychedelicraftHelper.transformMeta(growthMeta);
  }
 else   if (seed == Items.nether_wart) {
    return (int)Math.ceil(((float)growthMeta - 2) / 2);
  }
 else {
    return growthMeta;
  }
}
Program: 95677
Project: 95677
Buggy source:
public static ArrayList<ItemStack> getAllPlantFruits(ItemSeeds seed,World world,int x,int y,int z,int gain,int meta){
  Block plant=getPlant(seed);
  ArrayList<ItemStack> items=new ArrayList<ItemStack>();
  if (plant instanceof BlockModPlant) {
    items.addAll(((BlockModPlant)plant).getFruits());
  }
 else   if (ModIntegration.LoadedMods.chococraft && seed instanceof ItemGysahlSeeds) {
    items.addAll(ChococraftHelper.getFruits());
  }
 else {
    items=getPlantFruits(seed,world,x,y,z,gain,meta);
  }
  return items;
}

Fixed version (ground truth):
public static ArrayList<ItemStack> getAllPlantFruits(ItemSeeds seed,World world,int x,int y,int z,int gain,int meta){
  Block plant=getPlant(seed);
  ArrayList<ItemStack> items=new ArrayList<ItemStack>();
  if (plant instanceof BlockModPlant) {
    items.addAll(((BlockModPlant)plant).getFruits());
  }
 else   if (ModIntegration.LoadedMods.chococraft && seed instanceof ItemGysahlSeeds) {
    items.addAll(ChococraftHelper.getFruits());
  }
 else {
    items=(ArrayList<ItemStack>)getFruitsFromOreDict(seed,meta);
  }
  if (items.size() == 0) {
    items=getPlantFruits(seed,world,x,y,z,gain,meta);
  }
  return items;
}
Program: 95679
Project: 95679
Buggy source:
public static Block getPlant(ItemSeeds seed){
  if (seed == null) {
    return null;
  }
 else   if (seed == Items.melon_seeds) {
    return Crops.melon;
  }
 else   if (seed == Items.pumpkin_seeds) {
    return Crops.pumpkin;
  }
 else {
    if (seed.getPlant(null,0,0,0) instanceof BlockCrops) {
      return (BlockCrops)seed.getPlant(null,0,0,0);
    }
 else {
      return seed.getPlant(null,0,0,0);
    }
  }
}

Fixed version (ground truth):
public static Block getPlant(ItemSeeds seed){
  if (seed == null) {
    return null;
  }
 else   if (seed == Items.melon_seeds) {
    return Crops.melon;
  }
 else   if (seed == Items.pumpkin_seeds) {
    return Crops.pumpkin;
  }
 else {
    return seed.getPlant(null,0,0,0);
  }
}
Program: 95680
Project: 95680
Buggy source:
/** 
 * Applies one of the 2 strategies and notifies the TE if it should update
 */
public void executeCrossOver(){
  ICrossOverStrategy strategy=rollStrategy();
  CrossOverResult result=strategy.executeStrategy();
  if (result == null) {
    return;
  }
  if (resultIsValid(result) && random.nextDouble() < result.getChance()) {
    crop.applyCrossOverResult(result);
  }
}

Fixed version (ground truth):
/** 
 * Applies one of the 2 strategies and notifies the TE if it should update
 */
public void executeCrossOver(){
  ICrossOverStrategy strategy=rollStrategy();
  CrossOverResult result=strategy.executeStrategy();
  if (result == null || result.getSeed() == null) {
    return;
  }
  if (resultIsValid(result) && random.nextDouble() < result.getChance()) {
    crop.applyCrossOverResult(result);
  }
}
Program: 95681
Project: 95681
Buggy source:
private void addMaterialToList(ItemStack stack,List list,int objectMeta,ArrayList<ItemStack> registeredMaterials){
  if (!this.hasMaterial(registeredMaterials,stack)) {
    ItemStack entry=new ItemStack(this.field_150939_a,1,objectMeta);
    NBTTagCompound tag=NBTHelper.getMaterialTag(stack);
    if (tag != null) {
      entry.setTagCompound(tag);
    }
    list.add(entry);
    registeredMaterials.add(stack);
  }
}

Fixed version (ground truth):
private void addMaterialToList(ItemStack stack,List list,int objectMeta,ArrayList<ItemStack> registeredMaterials){
  if (!this.hasMaterial(registeredMaterials,stack)) {
    ItemStack entry=new ItemStack(this.field_150939_a,1,objectMeta);
    NBTTagCompound tag=NBTHelper.getMaterialTag(stack);
    if (tag != null) {
      entry.setTagCompound(tag);
      list.add(entry);
      registeredMaterials.add(stack);
    }
  }
}
Program: 95682
Project: 95682
Buggy source:
public static NBTTagCompound getMaterialTag(ItemStack stack){
  NBTTagCompound tag=new NBTTagCompound();
  if (stack != null && stack.getItem() != null) {
    tag.setString(Names.NBT.material,Block.blockRegistry.getNameForObject(((ItemBlock)stack.getItem()).field_150939_a));
    tag.setInteger(Names.NBT.materialMeta,stack.getItemDamage());
  }
  return tag;
}

Fixed version (ground truth):
public static NBTTagCompound getMaterialTag(ItemStack stack){
  NBTTagCompound tag=null;
  if (stack != null && stack.getItem() != null) {
    String name=Block.blockRegistry.getNameForObject(((ItemBlock)stack.getItem()).field_150939_a);
    if (name != null && !name.equals("String_Node_Str")) {
      tag=new NBTTagCompound();
      tag.setString(Names.NBT.material,name);
      tag.setInteger(Names.NBT.materialMeta,stack.getItemDamage());
    }
  }
  return tag;
}
Program: 95684
Project: 95684
Buggy source:
@Override public void dropBlockAsItemWithChance(World world,int x,int y,int z,int meta,float f,int i){
  if (!world.isRemote) {
    TileEntityCrop crop=(TileEntityCrop)world.getTileEntity(x,y,z);
    if (crop != null) {
      ArrayList<ItemStack> drops=new ArrayList<ItemStack>();
      if (crop.crossCrop) {
        drops.add(new ItemStack(Items.crops,2));
      }
 else {
        drops.add(new ItemStack(Items.crops,1));
        if (crop.hasPlant()) {
          drops.add(crop.getSeedStack());
          if (this.isMature(world,x,y,z)) {
            drops.addAll(SeedHelper.getPlantFruits((ItemSeeds)crop.seed,world,x,y,z,crop.gain,crop.seedMeta));
          }
        }
      }
      for (      ItemStack drop : drops) {
        this.dropBlockAsItem(world,x,y,z,drop);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void dropBlockAsItemWithChance(World world,int x,int y,int z,int meta,float f,int i){
  if (!world.isRemote) {
    TileEntityCrop crop=(TileEntityCrop)world.getTileEntity(x,y,z);
    if (crop != null) {
      ArrayList<ItemStack> drops=new ArrayList<ItemStack>();
      if (crop.crossCrop) {
        drops.add(new ItemStack(Items.crops,2));
      }
 else {
        drops.add(new ItemStack(Items.crops,1));
        if (crop.hasPlant()) {
          drops.add(crop.getSeedStack());
          if (this.isMature(world,x,y,z)) {
            drops.addAll(SeedHelper.getPlantFruits(crop.seed,world,x,y,z,crop.gain,crop.seedMeta));
          }
        }
      }
      for (      ItemStack drop : drops) {
        this.dropBlockAsItem(world,x,y,z,drop);
      }
    }
  }
}
Program: 95685
Project: 95685
Buggy source:
@Override public boolean canUproot(World world,int x,int y,int z){
  if (!world.isRemote) {
    TileEntity te=world.getTileEntity(x,y,z);
    if (te != null && te instanceof TileEntityCrop) {
      TileEntityCrop crop=(TileEntityCrop)te;
      if (crop.hasPlant()) {
        ArrayList<ItemStack> drops=new ArrayList<ItemStack>();
        if (crop.isMature()) {
          drops.addAll(SeedHelper.getPlantFruits((ItemSeeds)crop.seed,world,x,y,z,crop.gain,crop.seedMeta));
        }
        drops.add(crop.getSeedStack());
        for (        ItemStack drop : drops) {
          this.dropBlockAsItem(world,x,y,z,drop);
        }
      }
      crop.clearPlant();
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean canUproot(World world,int x,int y,int z){
  if (!world.isRemote) {
    TileEntity te=world.getTileEntity(x,y,z);
    if (te != null && te instanceof TileEntityCrop) {
      TileEntityCrop crop=(TileEntityCrop)te;
      if (crop.hasPlant()) {
        ArrayList<ItemStack> drops=new ArrayList<ItemStack>();
        if (crop.isMature()) {
          drops.addAll(SeedHelper.getPlantFruits(crop.seed,world,x,y,z,crop.gain,crop.seedMeta));
        }
        drops.add(crop.getSeedStack());
        for (        ItemStack drop : drops) {
          this.dropBlockAsItem(world,x,y,z,drop);
        }
      }
      crop.clearPlant();
    }
  }
  return false;
}
Program: 95686
Project: 95686
Buggy source:
@Override public boolean func_149852_a(World world,Random rand,int x,int y,int z){
  TileEntityCrop crop=(TileEntityCrop)world.getTileEntity(x,y,z);
  if (crop.crossCrop) {
    return ConfigurationHandler.bonemealMutation;
  }
  if (crop.hasPlant()) {
    if (SeedHelper.getSeedTier((ItemSeeds)crop.seed,crop.seedMeta) < 4) {
      return !this.isMature(world,x,y,z);
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean func_149852_a(World world,Random rand,int x,int y,int z){
  TileEntityCrop crop=(TileEntityCrop)world.getTileEntity(x,y,z);
  if (crop.crossCrop) {
    return ConfigurationHandler.bonemealMutation;
  }
  if (crop.hasPlant()) {
    if (SeedHelper.getSeedTier(crop.seed,crop.seedMeta) < 4) {
      return !this.isMature(world,x,y,z);
    }
  }
  return false;
}
Program: 95688
Project: 95688
Buggy source:
public boolean harvest(World world,int x,int y,int z){
  if (!world.isRemote) {
    boolean update=false;
    TileEntityCrop crop=(TileEntityCrop)world.getTileEntity(x,y,z);
    if (crop.weed) {
      crop.clearWeed();
    }
 else     if (crop.crossCrop) {
      crop.crossCrop=false;
      this.dropBlockAsItem(world,x,y,z,new ItemStack(Items.crops,1));
      update=true;
    }
 else     if (crop.isMature()) {
      crop.getWorldObj().setBlockMetadataWithNotify(crop.xCoord,crop.yCoord,crop.zCoord,2,2);
      update=true;
      ArrayList<ItemStack> drops=SeedHelper.getPlantFruits((ItemSeeds)crop.seed,world,x,y,z,crop.gain,crop.seedMeta);
      for (      ItemStack drop : drops) {
        this.dropBlockAsItem(world,x,y,z,drop);
      }
    }
    if (update) {
      crop.markForUpdate();
    }
    return update;
  }
  return false;
}

Fixed version (ground truth):
public boolean harvest(World world,int x,int y,int z){
  if (!world.isRemote) {
    boolean update=false;
    TileEntityCrop crop=(TileEntityCrop)world.getTileEntity(x,y,z);
    if (crop.weed) {
      crop.clearWeed();
    }
 else     if (crop.crossCrop) {
      crop.crossCrop=false;
      this.dropBlockAsItem(world,x,y,z,new ItemStack(Items.crops,1));
      update=true;
    }
 else     if (crop.isMature()) {
      crop.getWorldObj().setBlockMetadataWithNotify(crop.xCoord,crop.yCoord,crop.zCoord,2,2);
      update=true;
      ArrayList<ItemStack> drops=SeedHelper.getPlantFruits(crop.seed,world,x,y,z,crop.gain,crop.seedMeta);
      for (      ItemStack drop : drops) {
        this.dropBlockAsItem(world,x,y,z,drop);
      }
    }
    if (update) {
      crop.markForUpdate();
    }
    return update;
  }
  return false;
}
Program: 95689
Project: 95689
Buggy source:
@Override public ArrayList<ItemStack> getDrops(World world,int x,int y,int z,int metadata,int fortune){
  ArrayList<ItemStack> items=new ArrayList<ItemStack>();
  if (world.getTileEntity(x,y,z) != null && world.getTileEntity(x,y,z) instanceof TileEntityCrop) {
    TileEntityCrop crop=(TileEntityCrop)world.getTileEntity(x,y,z);
    if (crop.crossCrop) {
      items.add(new ItemStack(Items.crops,2));
    }
 else {
      items.add(new ItemStack(Items.crops,1));
    }
    if (crop.hasPlant()) {
      ItemStack seedStack=crop.getSeedStack().copy();
      items.add(seedStack);
      if (crop.isMature()) {
        items.addAll(SeedHelper.getPlantFruits((ItemSeeds)crop.seed,crop.getWorldObj(),crop.xCoord,crop.yCoord,crop.zCoord,crop.gain,crop.seedMeta));
      }
    }
  }
  return items;
}

Fixed version (ground truth):
@Override public ArrayList<ItemStack> getDrops(World world,int x,int y,int z,int metadata,int fortune){
  ArrayList<ItemStack> items=new ArrayList<ItemStack>();
  if (world.getTileEntity(x,y,z) != null && world.getTileEntity(x,y,z) instanceof TileEntityCrop) {
    TileEntityCrop crop=(TileEntityCrop)world.getTileEntity(x,y,z);
    if (crop.crossCrop) {
      items.add(new ItemStack(Items.crops,2));
    }
 else {
      items.add(new ItemStack(Items.crops,1));
    }
    if (crop.hasPlant()) {
      ItemStack seedStack=crop.getSeedStack().copy();
      items.add(seedStack);
      if (crop.isMature()) {
        items.addAll(SeedHelper.getPlantFruits(crop.seed,crop.getWorldObj(),crop.xCoord,crop.yCoord,crop.zCoord,crop.gain,crop.seedMeta));
      }
    }
  }
  return items;
}
Program: 95690
Project: 95690
Buggy source:
@SideOnly(Side.CLIENT) public int getRenderType(){
  int type=-1;
  if (this.hasPlant()) {
    type=RenderHelper.getRenderType((ItemSeeds)this.seed,this.seedMeta);
  }
 else   if (this.weed) {
    type=6;
  }
  return type;
}

Fixed version (ground truth):
@SideOnly(Side.CLIENT) public int getRenderType(){
  int type=-1;
  if (this.hasPlant()) {
    type=RenderHelper.getRenderType(this.seed,this.seedMeta);
  }
 else   if (this.weed) {
    type=6;
  }
  return type;
}
Program: 95691
Project: 95691
Buggy source:
@SideOnly(Side.CLIENT) public IIcon getPlantIcon(){
  IIcon icon=null;
  if (this.hasPlant()) {
    int meta=RenderHelper.plantIconIndex((ItemSeeds)this.seed,this.seedMeta,this.getBlockMetadata());
    icon=SeedHelper.getPlant((ItemSeeds)this.seed).getIcon(0,meta);
  }
 else   if (this.weed) {
    icon=((BlockCrop)this.worldObj.getBlock(this.xCoord,this.yCoord,this.zCoord)).getWeedIcon(this.getBlockMetadata());
  }
  return icon;
}

Fixed version (ground truth):
@SideOnly(Side.CLIENT) public IIcon getPlantIcon(){
  IIcon icon=null;
  if (this.hasPlant()) {
    int meta=RenderHelper.plantIconIndex(this.seed,this.seedMeta,this.getBlockMetadata());
    icon=SeedHelper.getPlant(this.seed).getIcon(0,meta);
  }
 else   if (this.weed) {
    icon=((BlockCrop)this.worldObj.getBlock(this.xCoord,this.yCoord,this.zCoord)).getWeedIcon(this.getBlockMetadata());
  }
  return icon;
}
Program: 95692
Project: 95692
Buggy source:
public ItemStack getSeedStack(){
  ItemStack seed=new ItemStack((ItemSeeds)this.seed,1,this.seedMeta);
  NBTTagCompound tag=new NBTTagCompound();
  SeedHelper.setNBT(tag,(short)this.growth,(short)this.gain,(short)this.strength,this.analyzed);
  seed.setTagCompound(tag);
  return seed;
}

Fixed version (ground truth):
public ItemStack getSeedStack(){
  ItemStack seed=new ItemStack(this.seed,1,this.seedMeta);
  NBTTagCompound tag=new NBTTagCompound();
  SeedHelper.setNBT(tag,(short)this.growth,(short)this.gain,(short)this.strength,this.analyzed);
  seed.setTagCompound(tag);
  return seed;
}
Program: 95693
Project: 95693
Buggy source:
@Override public void addDebugInfo(List<String> list){
  list.add("String_Node_Str");
  if (this.crossCrop) {
    list.add("String_Node_Str");
  }
 else   if (this.hasPlant()) {
    list.add("String_Node_Str");
    list.add("String_Node_Str" + ((ItemSeeds)this.seed).getUnlocalizedName());
    list.add("String_Node_Str" + Item.itemRegistry.getNameForObject(this.seed) + ':'+ this.seedMeta);
    list.add("String_Node_Str" + SeedHelper.getPlant((ItemSeeds)this.seed).getUnlocalizedName());
    list.add("String_Node_Str" + this.getBlockMetadata());
    list.add("String_Node_Str" + this.growth);
    list.add("String_Node_Str" + this.gain);
    list.add("String_Node_Str" + this.strength);
    list.add("String_Node_Str" + this.isFertile());
    list.add("String_Node_Str" + this.isMature());
  }
 else   if (this.weed) {
    list.add("String_Node_Str");
    list.add("String_Node_Str" + this.getBlockMetadata());
  }
 else {
    list.add("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void addDebugInfo(List<String> list){
  list.add("String_Node_Str");
  if (this.crossCrop) {
    list.add("String_Node_Str");
  }
 else   if (this.hasPlant()) {
    list.add("String_Node_Str");
    list.add("String_Node_Str" + (this.seed).getUnlocalizedName());
    list.add("String_Node_Str" + Item.itemRegistry.getNameForObject(this.seed) + ':'+ this.seedMeta);
    list.add("String_Node_Str" + SeedHelper.getPlant(this.seed).getUnlocalizedName());
    list.add("String_Node_Str" + this.getBlockMetadata());
    list.add("String_Node_Str" + this.growth);
    list.add("String_Node_Str" + this.gain);
    list.add("String_Node_Str" + this.strength);
    list.add("String_Node_Str" + this.isFertile());
    list.add("String_Node_Str" + this.isMature());
  }
 else   if (this.weed) {
    list.add("String_Node_Str");
    list.add("String_Node_Str" + this.getBlockMetadata());
  }
 else {
    list.add("String_Node_Str");
  }
}
Program: 95694
Project: 95694
Buggy source:
public boolean isFertile(){
  return GrowthRequirements.getGrowthRequirement((ItemSeeds)this.seed,this.seedMeta).canGrow(this.worldObj,this.xCoord,this.yCoord,this.zCoord);
}

Fixed version (ground truth):
public boolean isFertile(){
  return GrowthRequirements.getGrowthRequirement(this.seed,this.seedMeta).canGrow(this.worldObj,this.xCoord,this.yCoord,this.zCoord);
}
Program: 95695
Project: 95695
Buggy source:
public void addNeighbour(ForgeDirection direction,IPlantable plant,int meta,int growth,int gain,int strength){
  TileEntityCrop crop=new TileEntityCrop();
  crop.setWorldObj(world);
  crop.seed=plant;
  crop.seedMeta=meta;
  crop.growth=growth;
  crop.gain=gain;
  crop.strength=strength;
  crop.xCoord=targetCrop.xCoord + direction.offsetX;
  crop.yCoord=targetCrop.yCoord + direction.offsetY;
  crop.zCoord=targetCrop.zCoord + direction.offsetZ;
  when(world.getTileEntity(crop.xCoord,crop.yCoord,crop.zCoord)).thenReturn(crop);
  when(world.getBlock(crop.xCoord,crop.yCoord,crop.zCoord)).thenReturn(new BlockCrop());
  when(world.getBlockMetadata(crop.xCoord,crop.yCoord,crop.zCoord)).thenReturn(meta);
}

Fixed version (ground truth):
public void addNeighbour(ForgeDirection direction,ItemSeeds plant,int meta,int growth,int gain,int strength){
  TileEntityCrop crop=new TileEntityCrop();
  crop.setWorldObj(world);
  crop.seed=plant;
  crop.seedMeta=meta;
  crop.growth=growth;
  crop.gain=gain;
  crop.strength=strength;
  crop.xCoord=targetCrop.xCoord + direction.offsetX;
  crop.yCoord=targetCrop.yCoord + direction.offsetY;
  crop.zCoord=targetCrop.zCoord + direction.offsetZ;
  when(world.getTileEntity(crop.xCoord,crop.yCoord,crop.zCoord)).thenReturn(crop);
  when(world.getBlock(crop.xCoord,crop.yCoord,crop.zCoord)).thenReturn(new BlockCrop());
  when(world.getBlockMetadata(crop.xCoord,crop.yCoord,crop.zCoord)).thenReturn(meta);
}
Program: 95696
Project: 95696
Buggy source:
public static void addFruitsFromOreDict(List<ItemStack> list,ItemSeeds seed,int meta,Random rand,int nr){
  int counter=0;
  List<ItemStack> fruits=getFruitsFromOreDict(seed,meta);
  while (counter < nr) {
    ItemStack newFruit=fruits.get(rand.nextInt(fruits.size())).copy();
    newFruit.stackSize=1;
    list.add(newFruit);
    counter++;
  }
}

Fixed version (ground truth):
public static void addFruitsFromOreDict(List<ItemStack> list,ItemSeeds seed,int meta,Random rand,int nr){
  int counter=0;
  List<ItemStack> fruits=getFruitsFromOreDict(seed,meta);
  if (fruits != null && fruits.size() > 0) {
    while (counter < nr) {
      ItemStack newFruit=fruits.get(rand.nextInt(fruits.size())).copy();
      newFruit.stackSize=1;
      list.add(newFruit);
      counter++;
    }
  }
}
Program: 95697
Project: 95697
Buggy source:
@Mod.EventHandler public static void init(FMLInitializationEvent event){
  LogHelper.info("String_Node_Str");
  ResourceCrops.init();
  Seeds.init();
  NetworkRegistry.INSTANCE.registerGuiHandler(instance,new GuiHandler());
  proxy.registerTileEntities();
  proxy.registerRenderers();
  ModIntegration.init();
  LogHelper.info("String_Node_Str");
}

Fixed version (ground truth):
@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");
}
Program: 95698
Project: 95698
Buggy source:
@Mod.EventHandler public static void preInit(FMLPreInitializationEvent event){
  LogHelper.info("String_Node_Str");
  ModIntegration.LoadedMods.init();
  proxy.registerEventHandlers();
  NetworkWrapperAgriCraft.init();
  ConfigurationHandler.init(event);
  FMLCommonHandler.instance().bus().register(new ConfigurationHandler());
  if (ConfigurationHandler.debug) {
    FMLCommonHandler.instance().bus().register(new RenderLogger());
  }
  Blocks.init();
  Crops.init();
  Items.init();
  LogHelper.info("String_Node_Str");
}

Fixed version (ground truth):
@Mod.EventHandler public static void preInit(FMLPreInitializationEvent event){
  LogHelper.debug("String_Node_Str");
  ModIntegration.LoadedMods.init();
  proxy.registerEventHandlers();
  NetworkWrapperAgriCraft.init();
  ConfigurationHandler.init(event);
  FMLCommonHandler.instance().bus().register(new ConfigurationHandler());
  if (ConfigurationHandler.debug) {
    FMLCommonHandler.instance().bus().register(new RenderLogger());
  }
  Blocks.init();
  Crops.init();
  Items.init();
  LogHelper.debug("String_Node_Str");
}
Program: 95699
Project: 95699
Buggy source:
@Mod.EventHandler public static void postInit(FMLPostInitializationEvent event){
  LogHelper.info("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.info("String_Node_Str");
}

Fixed version (ground truth):
@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");
}
Program: 95702
Project: 95702
Buggy source:
@Override public void loadConfig(){
  if (ModIntegration.LoadedMods.nei) {
    if (ConfigurationHandler.enableNEI) {
      LogHelper.info("String_Node_Str");
      API.registerRecipeHandler(new NEICropMutationHandler());
      API.registerUsageHandler(new NEICropMutationHandler());
    }
    hideItems();
  }
}

Fixed version (ground truth):
@Override public void loadConfig(){
  if (ModIntegration.LoadedMods.nei) {
    if (ConfigurationHandler.enableNEI) {
      LogHelper.debug("String_Node_Str");
      API.registerRecipeHandler(new NEICropMutationHandler());
      API.registerUsageHandler(new NEICropMutationHandler());
    }
    hideItems();
  }
}