nus-yam/ex-repair huggingface dataset:
Program: 12679
Project: 12679
Buggy source:
/** 
 * @return If the crossbow can shoot without an arrow in the players inventory
 */
protected boolean isCrossbowInfinite(ItemStack stack,EntityPlayer player){
  int enchant=net.minecraft.enchantment.EnchantmentHelper.getEnchantmentLevel(net.minecraft.init.Enchantments.INFINITY,stack);
  return enchant > 0;
}

Fixed version (ground truth):
/** 
 * @return If the crossbow can shoot without an arrow in the players inventory
 */
protected boolean isCrossbowInfinite(ItemStack stack,EntityPlayer player){
  int enchant=EnchantmentHelper.getEnchantmentLevel(net.minecraft.init.Enchantments.INFINITY,stack);
  return enchant > 0;
}
Program: 12681
Project: 12681
Buggy source:
public int[] getItemRequirementsForTrainer(int targetLevel){
  if (!isLevelValidForTrainer(targetLevel)) {
    throw new IllegalArgumentException("String_Node_Str" + targetLevel);
  }
switch (targetLevel) {
case 5:
    return new int[]{5,0};
case 6:
  return new int[]{10,0};
case 7:
return new int[]{15,0};
case 8:
return new int[]{40,0};
case 9:
return new int[]{20,10};
case 10:
return new int[]{20,20};
case 11:
return new int[]{20,10};
case 12:
return new int[]{30,10};
case 13:
return new int[]{40,20};
case 14:
return new int[]{40,40};
}
return null;
}

Fixed version (ground truth):
public int[] getItemRequirementsForTrainer(int targetLevel){
  if (!isLevelValidForTrainer(targetLevel)) {
    throw new IllegalArgumentException("String_Node_Str" + targetLevel);
  }
switch (targetLevel) {
case 5:
    return new int[]{5,0};
case 6:
  return new int[]{10,0};
case 7:
return new int[]{15,0};
case 8:
return new int[]{40,0};
case 9:
return new int[]{20,10};
case 10:
return new int[]{20,20};
case 11:
return new int[]{20,10};
case 12:
return new int[]{30,10};
case 13:
return new int[]{40,20};
case 14:
return new int[]{40,40};
default :
VampirismMod.log.w("String_Node_Str","String_Node_Str");
}
return null;
}
Program: 12682
Project: 12682
Buggy source:
@SuppressWarnings("String_Node_Str") public static ICapabilityProvider createNewCapability(final EntityPlayer player){
  return new ICapabilitySerializable<NBTTagCompound>(){
    IHunterPlayer inst=new HunterPlayer(player);
    @Override public void deserializeNBT(    NBTTagCompound nbt){
      CAP.getStorage().readNBT(CAP,inst,null,nbt);
    }
    @Override public <T>T getCapability(    Capability<T> capability,    EnumFacing facing){
      return capability == CAP ? (T)(inst) : null;
    }
    @Override public boolean hasCapability(    Capability<?> capability,    EnumFacing facing){
      return capability == CAP;
    }
    @Override public NBTTagCompound serializeNBT(){
      return (NBTTagCompound)CAP.getStorage().writeNBT(CAP,inst,null);
    }
  }
;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static ICapabilityProvider createNewCapability(final EntityPlayer player){
  return new ICapabilitySerializable<NBTTagCompound>(){
    IHunterPlayer inst=new HunterPlayer(player);
    @Override public void deserializeNBT(    NBTTagCompound nbt){
      CAP.getStorage().readNBT(CAP,inst,null,nbt);
    }
    @Override public <T>T getCapability(    Capability<T> capability,    EnumFacing facing){
      return capability == CAP ? CAP.<T>cast(inst) : null;
    }
    @Override public boolean hasCapability(    Capability<?> capability,    EnumFacing facing){
      return CAP.equals(capability);
    }
    @Override public NBTTagCompound serializeNBT(){
      return (NBTTagCompound)CAP.getStorage().writeNBT(CAP,inst,null);
    }
  }
;
}
Program: 12683
Project: 12683
Buggy source:
@Override public <T>T getCapability(Capability<T> capability,EnumFacing facing){
  return capability == CAP ? (T)(inst) : null;
}

Fixed version (ground truth):
@Override public <T>T getCapability(Capability<T> capability,EnumFacing facing){
  return capability == CAP ? CAP.<T>cast(inst) : null;
}
Program: 12684
Project: 12684
Buggy source:
@Override public boolean hasCapability(Capability<?> capability,EnumFacing facing){
  return capability == CAP;
}

Fixed version (ground truth):
@Override public boolean hasCapability(Capability<?> capability,EnumFacing facing){
  return CAP.equals(capability);
}
Program: 12686
Project: 12686
Buggy source:
@Override public void unUnlockVision(@Nonnull IVampireVision vision){
  if (activatedVision == vision) {
    activateVision(null);
  }
  unlockedVisions.remove(vision);
}

Fixed version (ground truth):
@Override public void unUnlockVision(@Nonnull IVampireVision vision){
  if (vision.equals(activatedVision)) {
    activateVision(null);
  }
  unlockedVisions.remove(vision);
}
Program: 12687
Project: 12687
Buggy source:
@Override public boolean hasCapability(Capability<?> capability,EnumFacing facing){
  return capability == CAP;
}

Fixed version (ground truth):
@Override public boolean hasCapability(Capability<?> capability,EnumFacing facing){
  return CAP.equals(capability);
}
Program: 12688
Project: 12688
Buggy source:
@SuppressWarnings("String_Node_Str") public static ICapabilityProvider createNewCapability(final EntityPlayer player){
  return new ICapabilitySerializable<NBTTagCompound>(){
    IVampirePlayer inst=new VampirePlayer(player);
    @Override public void deserializeNBT(    NBTTagCompound nbt){
      CAP.getStorage().readNBT(CAP,inst,null,nbt);
    }
    @Override public <T>T getCapability(    Capability<T> capability,    EnumFacing facing){
      return CAP.equals(capability) ? CAP.<T>cast(inst) : null;
    }
    @Override public boolean hasCapability(    Capability<?> capability,    EnumFacing facing){
      return capability == CAP;
    }
    @Override public NBTTagCompound serializeNBT(){
      return (NBTTagCompound)CAP.getStorage().writeNBT(CAP,inst,null);
    }
  }
;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static ICapabilityProvider createNewCapability(final EntityPlayer player){
  return new ICapabilitySerializable<NBTTagCompound>(){
    IVampirePlayer inst=new VampirePlayer(player);
    @Override public void deserializeNBT(    NBTTagCompound nbt){
      CAP.getStorage().readNBT(CAP,inst,null,nbt);
    }
    @Override public <T>T getCapability(    Capability<T> capability,    EnumFacing facing){
      return CAP.equals(capability) ? CAP.<T>cast(inst) : null;
    }
    @Override public boolean hasCapability(    Capability<?> capability,    EnumFacing facing){
      return CAP.equals(capability);
    }
    @Override public NBTTagCompound serializeNBT(){
      return (NBTTagCompound)CAP.getStorage().writeNBT(CAP,inst,null);
    }
  }
;
}
Program: 12689
Project: 12689
Buggy source:
@Override public void activateVision(@Nullable IVampireVision vision){
  if (vision != null && !isRemote() && ((GeneralRegistryImpl)VampirismAPI.vampireVisionRegistry()).getIdOfVision(vision) == -1) {
    throw new IllegalArgumentException("String_Node_Str" + vision);
  }
  if (activatedVision != vision) {
    if (activatedVision != null) {
      activatedVision.onDeactivated(this);
    }
    activatedVision=vision;
    if (vision != null) {
      vision.onActivated(this);
    }
    if (!isRemote()) {
      NBTTagCompound nbt=new NBTTagCompound();
      nbt.setInteger(KEY_VISION,activatedVision == null ? -1 : ((GeneralRegistryImpl)VampirismAPI.vampireVisionRegistry()).getIdOfVision(activatedVision));
      this.sync(nbt,false);
    }
  }
}

Fixed version (ground truth):
@Override public void activateVision(@Nullable IVampireVision vision){
  if (vision != null && !isRemote() && ((GeneralRegistryImpl)VampirismAPI.vampireVisionRegistry()).getIdOfVision(vision) == -1) {
    throw new IllegalArgumentException("String_Node_Str" + vision);
  }
  if (!Objects.equals(activatedVision,vision)) {
    if (activatedVision != null) {
      activatedVision.onDeactivated(this);
    }
    activatedVision=vision;
    if (vision != null) {
      vision.onActivated(this);
    }
    if (!isRemote()) {
      NBTTagCompound nbt=new NBTTagCompound();
      nbt.setInteger(KEY_VISION,activatedVision == null ? -1 : ((GeneralRegistryImpl)VampirismAPI.vampireVisionRegistry()).getIdOfVision(activatedVision));
      this.sync(nbt,false);
    }
  }
}
Program: 12690
Project: 12690
Buggy source:
private boolean checkItemRequirements(EntityPlayer player){
  int newLevel=targetLevel;
  ItemStack missing=null;
switch (newLevel) {
case 5:
    missing=checkAndRemoveItems(0,0,5,0);
  break;
case 6:
missing=checkAndRemoveItems(0,1,0,0);
break;
case 7:
missing=checkAndRemoveItems(0,1,5,0);
break;
case 8:
missing=checkAndRemoveItems(1,1,0,0);
break;
case 9:
missing=checkAndRemoveItems(1,1,5,0);
break;
case 10:
missing=checkAndRemoveItems(2,1,5,0);
break;
case 11:
missing=checkAndRemoveItems(2,1,10,0);
break;
case 12:
missing=checkAndRemoveItems(3,1,10,0);
break;
case 13:
missing=checkAndRemoveItems(3,2,0,0);
break;
case 14:
missing=checkAndRemoveItems(4,2,0,0);
break;
}
if (missing != null) {
ITextComponent item=missing.getItem().equals(ModItems.pureBlood) ? ModItems.pureBlood.getDisplayName(missing) : new TextComponentTranslation(missing.getUnlocalizedName() + "String_Node_Str");
ITextComponent main=new TextComponentTranslation("String_Node_Str",missing.stackSize,item);
player.addChatComponentMessage(main);
return false;
}
return true;
}

Fixed version (ground truth):
private boolean checkItemRequirements(EntityPlayer player){
  int newLevel=targetLevel;
  ItemStack missing=null;
switch (newLevel) {
case 5:
    missing=checkAndRemoveItems(0,0,5,0);
  break;
case 6:
missing=checkAndRemoveItems(0,1,0,0);
break;
case 7:
missing=checkAndRemoveItems(0,1,5,0);
break;
case 8:
missing=checkAndRemoveItems(1,1,0,0);
break;
case 9:
missing=checkAndRemoveItems(1,1,5,0);
break;
case 10:
missing=checkAndRemoveItems(2,1,5,0);
break;
case 11:
missing=checkAndRemoveItems(2,1,10,0);
break;
case 12:
missing=checkAndRemoveItems(3,1,10,0);
break;
case 13:
missing=checkAndRemoveItems(3,2,0,0);
break;
case 14:
missing=checkAndRemoveItems(4,2,0,0);
break;
default :
VampirismMod.log.w(TAG,"String_Node_Str",newLevel);
}
if (missing != null) {
ITextComponent item=missing.getItem().equals(ModItems.pureBlood) ? ModItems.pureBlood.getDisplayName(missing) : new TextComponentTranslation(missing.getUnlocalizedName() + "String_Node_Str");
ITextComponent main=new TextComponentTranslation("String_Node_Str",missing.stackSize,item);
player.addChatComponentMessage(main);
return false;
}
return true;
}
Program: 12692
Project: 12692
Buggy source:
private boolean checkGroundAndPos(World worldIn,BlockPos position,IBlockState ground){
  if (worldIn.getBlockState(position).getMaterial().isLiquid())   return false;
  Material m=worldIn.getBlockState(position.down()).getMaterial();
  if (m.isLiquid())   return false;
  if (ground != null && m.isReplaceable()) {
    worldIn.setBlockState(position.down(),ground);
    return true;
  }
  return worldIn.isSideSolid(position.down(),EnumFacing.UP,false);
}

Fixed version (ground truth):
private boolean checkGroundAndPos(World worldIn,BlockPos position,IBlockState ground){
  if (worldIn.getBlockState(position).getMaterial().isLiquid())   return false;
  IBlockState b=worldIn.getBlockState(position.down());
  if (b.getMaterial().isLiquid() || b.getBlock() instanceof IFluidBlock)   return false;
  if (ground != null && b.getMaterial().isReplaceable()) {
    worldIn.setBlockState(position.down(),ground);
    return true;
  }
  return worldIn.isSideSolid(position.down(),EnumFacing.UP,false);
}
Program: 12694
Project: 12694
Buggy source:
@Override public boolean onBlockActivated(World worldIn,BlockPos pos,IBlockState state,EntityPlayer playerIn,EnumHand hand,@Nullable ItemStack heldItem,EnumFacing side,float hitX,float hitY,float hitZ){
  if (canUse(playerIn))   playerIn.openGui(VampirismMod.instance,ModGuiHandler.ID_BLOOD_POTION_TABLE,worldIn,pos.getX(),pos.getY(),pos.getZ());
 else {
    playerIn.addChatComponentMessage(new TextComponentTranslation("String_Node_Str" + regName + "String_Node_Str"));
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onBlockActivated(World worldIn,BlockPos pos,IBlockState state,EntityPlayer playerIn,EnumHand hand,@Nullable ItemStack heldItem,EnumFacing side,float hitX,float hitY,float hitZ){
  if (!worldIn.isRemote) {
    if (canUse(playerIn))     playerIn.openGui(VampirismMod.instance,ModGuiHandler.ID_BLOOD_POTION_TABLE,worldIn,pos.getX(),pos.getY(),pos.getZ());
 else {
      playerIn.addChatComponentMessage(new TextComponentTranslation("String_Node_Str" + regName + "String_Node_Str"));
    }
  }
  return true;
}
Program: 12695
Project: 12695
Buggy source:
private static void preInit(FMLPreInitializationEvent event){
  thirst=register(new PotionThirst("String_Node_Str",true,859494));
  sanguinare=register(new PotionSanguinare("String_Node_Str",false,0x6A0888));
  saturation=register(new VampirismPotion("String_Node_Str",false,0xDCFF00));
  sunscreen=register(new VampirismPotion("String_Node_Str",false,0xFFF100));
  sunscreen.registerPotionAttributeModifier(VReference.sunDamage,"String_Node_Str",-0.3,2);
  disguiseAsVampire=register(new VampirismPotion("String_Node_Str",false,0x999900));
}

Fixed version (ground truth):
private static void preInit(FMLPreInitializationEvent event){
  thirst=register(new PotionThirst("String_Node_Str",true,859494));
  fakeNightVisionPotion=register(new FakeNightVisionPotion());
  sanguinare=register(new PotionSanguinare("String_Node_Str",false,0x6A0888));
  saturation=register(new VampirismPotion("String_Node_Str",false,0xDCFF00));
  sunscreen=register(new VampirismPotion("String_Node_Str",false,0xFFF100));
  sunscreen.registerPotionAttributeModifier(VReference.sunDamage,"String_Node_Str",-0.3,2);
  disguiseAsVampire=register(new VampirismPotion("String_Node_Str",false,0x999900));
}
Program: 12696
Project: 12696
Buggy source:
@SubscribeEvent public void onEntityUpdate(LivingEvent.LivingUpdateEvent event){
  if (event.getEntity() instanceof EntityCreature) {
    ExtendedCreature.get((EntityCreature)event.getEntity()).onUpdate();
  }
  if (!event.getEntity().worldObj.isRemote && event.getEntity() instanceof EntityPlayer) {
    EntityPlayer player=(EntityPlayer)event.getEntity();
    if (player.openContainer instanceof BloodPotionTableContainer) {
      ((BloodPotionTableContainer)player.openContainer).tick();
    }
  }
}

Fixed version (ground truth):
@SubscribeEvent public void onEntityUpdate(LivingEvent.LivingUpdateEvent event){
  if (event.getEntity() instanceof EntityCreature) {
    ExtendedCreature.get((EntityCreature)event.getEntity()).onUpdate();
  }
  if (!event.getEntity().worldObj.isRemote && event.getEntity() instanceof EntityPlayer) {
    EntityPlayer player=(EntityPlayer)event.getEntity();
    if (player.openContainer instanceof BloodPotionTableContainer) {
      ((BloodPotionTableContainer)player.openContainer).tick();
    }
  }
  PotionEffect vanillaNightVision=null;
  if (FakeNightVisionPotion.vanillaInstance != null && (vanillaNightVision=event.getEntityLiving().getActivePotionEffect(FakeNightVisionPotion.vanillaInstance)) != null) {
    event.getEntityLiving().removePotionEffect(FakeNightVisionPotion.vanillaInstance);
    event.getEntityLiving().addPotionEffect(new PotionEffect(ModPotions.fakeNightVisionPotion,vanillaNightVision.getDuration(),vanillaNightVision.getAmplifier(),vanillaNightVision.getIsAmbient(),vanillaNightVision.doesShowParticles()));
    VampirismMod.log.d("String_Node_Str","String_Node_Str");
  }
}
Program: 12697
Project: 12697
Buggy source:
/** 
 * Notify faction about changes.  {@link FactionPlayerHandler#currentFaction} and {@link FactionPlayerHandler#currentLevel} will be used as the new ones
 * @param oldFaction
 * @param oldLevel
 */
private void notifyFaction(IPlayableFaction oldFaction,int oldLevel){
  if (oldFaction != null && !oldFaction.equals(currentFaction)) {
    VampirismMod.log.d(TAG,"String_Node_Str",oldFaction.getKey());
    oldFaction.getPlayerCapability(player).onLevelChanged(0,oldLevel);
  }
  if (currentFaction != null) {
    VampirismMod.log.d(TAG,"String_Node_Str",currentFaction,currentLevel);
    currentFaction.getPlayerCapability(player).onLevelChanged(currentLevel,oldFaction == currentFaction ? oldLevel : 0);
  }
  if (!Objects.equals(currentFaction,oldFaction)) {
    onChangedFaction();
  }
}

Fixed version (ground truth):
/** 
 * Notify faction about changes.  {@link FactionPlayerHandler#currentFaction} and {@link FactionPlayerHandler#currentLevel} will be used as the new ones
 * @param oldFaction
 * @param oldLevel
 */
private void notifyFaction(IPlayableFaction oldFaction,int oldLevel){
  if (oldFaction != null && !oldFaction.equals(currentFaction)) {
    VampirismMod.log.d(TAG,"String_Node_Str",oldFaction.getKey());
    oldFaction.getPlayerCapability(player).onLevelChanged(0,oldLevel);
  }
  if (currentFaction != null) {
    VampirismMod.log.d(TAG,"String_Node_Str",currentFaction,currentLevel);
    currentFaction.getPlayerCapability(player).onLevelChanged(currentLevel,Objects.equals(oldFaction,currentFaction) ? oldLevel : 0);
  }
  if (!Objects.equals(currentFaction,oldFaction)) {
    onChangedFaction();
  }
}
Program: 12698
Project: 12698
Buggy source:
/** 
 * Called via a player living update event every tick serverside while the container is opened.
 */
public void tick(){
  if (craftingTimer > 0) {
    craftingTimer--;
    if (craftingTimer == 0) {
      onCraftingTimerFinished();
    }
  }
}

Fixed version (ground truth):
/** 
 * Called via a player living update event every tick serverside while the container is opened.
 */
public void tick(){
  if (craftingTimer > 0) {
    craftingTimer--;
    if (craftingTimer == 0) {
      onCraftingTimerFinished();
    }
 else     if (craftingTimer % 5 == 0) {
      if (!areRequirementsMet()) {
        craftingTimer=0;
      }
    }
  }
}
Program: 12699
Project: 12699
Buggy source:
public ItemBloodPotion(){
  super(regName);
  this.setMaxDamage(1);
  this.setCreativeTab(null);
}

Fixed version (ground truth):
public ItemBloodPotion(){
  super(regName);
  this.setMaxDamage(1);
  this.setMaxStackSize(1);
  this.setCreativeTab(null);
}
Program: 12700
Project: 12700
Buggy source:
@Override public void onLevelChanged(int old,int level){
  if (!isRemote()) {
    LevelAttributeModifier.applyModifier(player,SharedMonsterAttributes.ATTACK_DAMAGE,"String_Node_Str",getLevel(),Balance.hp.STRENGTH_LCAP,Balance.hp.STRENGTH_MAX_MOD,Balance.hp.STRENGTH_TYPE);
    actionHandler.resetTimers();
    if (level > 0) {
      if (player instanceof EntityPlayerMP && ((EntityPlayerMP)player).connection != null) {
        player.addStat(Achievements.becomingAHunter,1);
      }
      if (old == 0) {
        skillHandler.enableRootSkill();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onLevelChanged(int level,int oldLevel){
  if (!isRemote()) {
    LevelAttributeModifier.applyModifier(player,SharedMonsterAttributes.ATTACK_DAMAGE,"String_Node_Str",getLevel(),Balance.hp.STRENGTH_LCAP,Balance.hp.STRENGTH_MAX_MOD,Balance.hp.STRENGTH_TYPE);
    actionHandler.resetTimers();
    if (level > 0) {
      if (player instanceof EntityPlayerMP && ((EntityPlayerMP)player).connection != null) {
        player.addStat(Achievements.becomingAHunter,1);
      }
      if (oldLevel == 0) {
        skillHandler.enableRootSkill();
      }
    }
  }
}
Program: 12701
Project: 12701
Buggy source:
@Override public void onUpdate(){
  int level=getLevel();
  if (!isRemote()) {
    if (level > 0) {
      boolean sync=false;
      boolean syncToAll=false;
      NBTTagCompound syncPacket=new NBTTagCompound();
      if (actionHandler.updateActions()) {
        sync=true;
        syncToAll=true;
        actionHandler.writeUpdateForClient(syncPacket);
      }
      if (sync) {
        sync(syncPacket,syncToAll);
      }
    }
  }
 else {
    if (level > 0) {
      actionHandler.updateActions();
    }
  }
}

Fixed version (ground truth):
@Override public void onUpdate(){
  int level=getLevel();
  if (!isRemote()) {
    if (level > 0) {
      boolean sync=false;
      boolean syncToAll=false;
      NBTTagCompound syncPacket=new NBTTagCompound();
      if (actionHandler.updateActions()) {
        sync=true;
        syncToAll=true;
        actionHandler.writeUpdateForClient(syncPacket);
      }
      if (skillHandler.isDirty()) {
        sync=true;
        skillHandler.writeUpdateForClient(syncPacket);
      }
      if (sync) {
        sync(syncPacket,syncToAll);
      }
    }
  }
 else {
    if (level > 0) {
      actionHandler.updateActions();
    }
  }
}
Program: 12702
Project: 12702
Buggy source:
@Override public void onUpdate(IVampirePlayer player){
  if (player.getRepresentingPlayer().ticksExisted % 50 == 8 && player.getRepresentingPlayer().getActivePotionEffect(MobEffects.NIGHT_VISION) == null) {
    player.getRepresentingPlayer().addPotionEffect(new FakeNightVisionPotionEffect());
  }
}

Fixed version (ground truth):
@Override public void onUpdate(IVampirePlayer player){
  if (player.getRepresentingPlayer().ticksExisted % 50 == 8) {
    PotionEffect effect=player.getRepresentingPlayer().getActivePotionEffect(MobEffects.NIGHT_VISION);
    if (!(effect instanceof FakeNightVisionPotionEffect)) {
      player.getRepresentingPlayer().removeActivePotionEffect(MobEffects.NIGHT_VISION);
      effect=null;
    }
    if (effect == null) {
      player.getRepresentingPlayer().addPotionEffect(new FakeNightVisionPotionEffect());
    }
  }
}
Program: 12703
Project: 12703
Buggy source:
/** 
 * Replace the night vision potion in   {@link MobEffects} by the fake version.Checks if it is enabled in the configs first
 */
public static void replaceNightVision(){
  if (!Configs.disable_replaceVanillaNightVision) {
    VampirismMod.log.d("String_Node_Str","String_Node_Str",MobEffects.NIGHT_VISION.getClass());
    try {
      Field field=ReflectionHelper.findField(MobEffects.class,"String_Node_Str",SRGNAMES.MobEffects_nightVision);
      field.setAccessible(true);
      Field modifierField=Field.class.getDeclaredField("String_Node_Str");
      modifierField.setAccessible(true);
      modifierField.setInt(field,field.getModifiers() & ~Modifier.FINAL);
      field.set(null,instance);
    }
 catch (    ReflectionHelper.UnableToFindFieldException e) {
      VampirismMod.log.e("String_Node_Str",e,"String_Node_Str");
    }
catch (    IllegalAccessException e) {
      VampirismMod.log.e("String_Node_Str",e,"String_Node_Str");
    }
catch (    NoSuchFieldException e) {
      VampirismMod.log.e("String_Node_Str",e,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Replace the night vision potion in   {@link MobEffects} by the fake version.Checks if it is enabled in the configs first
 */
public static void replaceNightVision(){
  if (!Configs.disable_replaceVanillaNightVision && !(MobEffects.NIGHT_VISION instanceof FakeNightVisionPotion)) {
    VampirismMod.log.d("String_Node_Str","String_Node_Str",MobEffects.NIGHT_VISION.getClass());
    try {
      vanillaInstance=MobEffects.NIGHT_VISION;
      Field field=ReflectionHelper.findField(MobEffects.class,"String_Node_Str",SRGNAMES.MobEffects_nightVision);
      field.setAccessible(true);
      Field modifierField=Field.class.getDeclaredField("String_Node_Str");
      modifierField.setAccessible(true);
      modifierField.setInt(field,field.getModifiers() & ~Modifier.FINAL);
      field.set(null,ModPotions.fakeNightVisionPotion);
    }
 catch (    ReflectionHelper.UnableToFindFieldException e) {
      VampirismMod.log.e("String_Node_Str",e,"String_Node_Str");
    }
catch (    IllegalAccessException e) {
      VampirismMod.log.e("String_Node_Str",e,"String_Node_Str");
    }
catch (    NoSuchFieldException e) {
      VampirismMod.log.e("String_Node_Str",e,"String_Node_Str");
    }
  }
}
Program: 12704
Project: 12704
Buggy source:
protected FakeNightVisionPotion(){
  super(false,2039713);
  setIconIndex(4,1);
  setPotionName("String_Node_Str");
}

Fixed version (ground truth):
public FakeNightVisionPotion(){
  super(false,2039713);
  setIconIndex(4,1);
  setPotionName("String_Node_Str");
  this.setRegistryName(REFERENCE.MODID,"String_Node_Str");
}
Program: 12705
Project: 12705
Buggy source:
/** 
 * Adds a tooltip to the given blood potion itemstack
 */
public static void addTooltip(ItemStack stack,List<String> tooltip,IHunterPlayer player){
  ISkillHandler<IHunterPlayer> skillHandler=player.getSkillHandler();
  List<ConfiguredEffect> effects=stack.hasTagCompound() ? readEffectsFromNBT(stack.getTagCompound()) : Lists.<ConfiguredEffect>newArrayList();
  Random identifyRandom=null;
  if (skillHandler.isSkillEnabled(HunterSkills.bloodPotion_identifySome)) {
    NBTTagCompound nbt=stack.hasTagCompound() ? stack.getTagCompound() : new NBTTagCompound();
    int seed;
    if (nbt.hasKey("String_Node_Str")) {
      seed=nbt.getInteger("String_Node_Str");
    }
 else {
      seed=stack.hashCode();
      nbt.setInteger("String_Node_Str",seed);
      stack.setTagCompound(nbt);
    }
    identifyRandom=new Random(seed);
  }
  for (  ConfiguredEffect effect : effects) {
    String text;
    if (identifyRandom != null && identifyRandom.nextBoolean()) {
      text=effect.getEffect().getLocName(effect.properties);
    }
 else {
      text=UtilLib.translateToLocal("String_Node_Str");
    }
    if (skillHandler.isSkillEnabled(HunterSkills.bloodPotion_goodOrBad)) {
      if (effect.getEffect().isBad()) {
        text=TextFormatting.DARK_RED + text;
      }
 else {
        text=TextFormatting.DARK_GREEN + text;
      }
    }
    tooltip.add(text);
  }
}

Fixed version (ground truth):
/** 
 * Adds a tooltip to the given blood potion itemstack
 */
public static void addTooltip(ItemStack stack,List<String> tooltip,IHunterPlayer player){
  ISkillHandler<IHunterPlayer> skillHandler=player.getSkillHandler();
  List<ConfiguredEffect> effects=stack.hasTagCompound() ? readEffectsFromNBT(stack.getTagCompound()) : Lists.<ConfiguredEffect>newArrayList();
  Random identifyRandom=null;
  if (skillHandler.isSkillEnabled(HunterSkills.bloodPotion_identifySome)) {
    NBTTagCompound nbt=stack.hasTagCompound() ? stack.getTagCompound() : new NBTTagCompound();
    int seed;
    if (nbt.hasKey("String_Node_Str")) {
      seed=nbt.getInteger("String_Node_Str");
    }
 else {
      seed=stack.hashCode();
    }
    identifyRandom=new Random(seed);
  }
  for (  ConfiguredEffect effect : effects) {
    String text;
    if (identifyRandom != null && identifyRandom.nextBoolean()) {
      text=effect.getEffect().getLocName(effect.properties);
    }
 else {
      text=UtilLib.translateToLocal("String_Node_Str");
    }
    if (skillHandler.isSkillEnabled(HunterSkills.bloodPotion_goodOrBad)) {
      if (effect.getEffect().isBad()) {
        text=TextFormatting.DARK_RED + text;
      }
 else {
        text=TextFormatting.DARK_GREEN + text;
      }
    }
    tooltip.add(text);
  }
}
Program: 12706
Project: 12706
Buggy source:
/** 
 * Write the given effects to the potion stack's nbt
 */
private static void addEffects(ItemStack stack,List<ConfiguredEffect> effects){
  NBTTagCompound nbt=stack.hasTagCompound() ? stack.getTagCompound() : new NBTTagCompound();
  NBTTagCompound effectTag=new NBTTagCompound();
  for (  ConfiguredEffect effect : effects) {
    effectTag.setTag(effect.getEffect().getId(),effect.getProperties());
  }
  nbt.setTag("String_Node_Str",effectTag);
  stack.setTagCompound(nbt);
}

Fixed version (ground truth):
/** 
 * Write the given effects to the potion stack's nbt
 */
private static void addEffects(ItemStack stack,List<ConfiguredEffect> effects){
  NBTTagCompound nbt=stack.hasTagCompound() ? stack.getTagCompound() : new NBTTagCompound();
  NBTTagCompound effectTag=new NBTTagCompound();
  for (  ConfiguredEffect effect : effects) {
    effectTag.setTag(effect.getEffect().getId(),effect.getProperties());
  }
  nbt.setTag("String_Node_Str",effectTag);
  if (!nbt.hasKey("String_Node_Str")) {
    int seed=stack.hashCode();
    nbt.setInteger("String_Node_Str",seed);
  }
  stack.setTagCompound(nbt);
}
Program: 12707
Project: 12707
Buggy source:
/** 
 * Selects a random selection to the given potion stack considering the crafters hunter skills as well as the extra item
 */
public static void chooseAndAddEffects(@Nonnull ItemStack stack,@Nonnull IHunterPlayer crafter,@Nullable ItemStack extraItem){
  List<ConfiguredEffect> effects=Lists.newArrayList();
  IBloodPotionRegistry registry=VampirismAPI.bloodPotionRegistry();
  Random rnd=crafter.getRepresentingPlayer().getRNG();
  ISkillHandler<IHunterPlayer> skillHandler=crafter.getSkillHandler();
  int good=rnd.nextInt(2) + 1;
  if (rnd.nextInt(10) == 0)   good=3;
  int bad;
  int badReductions=0;
  if (skillHandler.isSkillEnabled(HunterSkills.bloodPotion_lessBad))   badReductions++;
  if (skillHandler.isSkillEnabled(HunterSkills.bloodPotion_lessBad2))   badReductions++;
  if (badReductions == 1) {
    bad=rnd.nextInt(10) == 0 ? 2 : 1;
  }
 else   if (badReductions == 2) {
    bad=rnd.nextInt(2);
  }
 else {
    bad=(rnd.nextInt(10) == 0) ? 3 : rnd.nextInt(2) + 1;
  }
  int extra=0;
  for (int i=0; i < good + bad + extra; i++) {
    IBloodPotionEffect effect=registry.getRandomEffect(extraItem,i >= good + extra,rnd);
    boolean valid=true;
    for (    ConfiguredEffect effect1 : effects) {
      if (!effect1.getEffect().canCoexist(effect)) {
        extra=Math.min(good + 1,5);
        valid=false;
      }
    }
    if (valid)     effects.add(new ConfiguredEffect(effect,effect.getRandomProperties(rnd)));
  }
  addEffects(stack,effects);
}

Fixed version (ground truth):
/** 
 * Selects a random selection to the given potion stack considering the crafters hunter skills as well as the extra item
 */
public static void chooseAndAddEffects(@Nonnull ItemStack stack,@Nonnull IHunterPlayer crafter,@Nullable ItemStack extraItem){
  List<ConfiguredEffect> effects=Lists.newArrayList();
  IBloodPotionRegistry registry=VampirismAPI.bloodPotionRegistry();
  Random rnd=crafter.getRepresentingPlayer().getRNG();
  ISkillHandler<IHunterPlayer> skillHandler=crafter.getSkillHandler();
  int good=rnd.nextInt(2) + 1;
  if (rnd.nextInt(10) == 0)   good=3;
  int bad;
  int badReductions=0;
  if (skillHandler.isSkillEnabled(HunterSkills.bloodPotion_lessBad))   badReductions++;
  if (skillHandler.isSkillEnabled(HunterSkills.bloodPotion_lessBad2))   badReductions++;
  if (badReductions == 1) {
    bad=rnd.nextInt(10) == 0 ? 2 : 1;
  }
 else   if (badReductions == 2) {
    bad=rnd.nextInt(2);
  }
 else {
    bad=(rnd.nextInt(10) == 0) ? 3 : rnd.nextInt(2) + 1;
  }
  int extra=0;
  for (int i=0; i < good + bad + extra; i++) {
    IBloodPotionEffect effect=registry.getRandomEffect(extraItem,i >= good + extra,rnd);
    boolean valid=true;
    for (    ConfiguredEffect effect1 : effects) {
      if (!effect1.getEffect().canCoexist(effect)) {
        extra=Math.min(extra + 1,5);
        valid=false;
      }
    }
    if (valid)     effects.add(new ConfiguredEffect(effect,effect.getRandomProperties(rnd)));
  }
  addEffects(stack,effects);
}
Program: 12708
Project: 12708
Buggy source:
/** 
 * Called when the entity is spawned in a castle as lord
 */
public void makeCastleLord(@NonNull CastlePositionData.Position pos){
  Logger.d(TAG,"String_Node_Str");
  ChunkCoordIntPair lc=pos.getLowerMainCastle();
  ChunkCoordIntPair uc=pos.getUpperMainCastle();
  this.setHome(AxisAlignedBB.getBoundingBox(lc.chunkXPos << 4,pos.getHeight() - 1,lc.chunkZPos << 4,(uc.chunkXPos << 4) + 15,pos.getHeight() + 5,(uc.chunkZPos << 4) + 15));
}

Fixed version (ground truth):
/** 
 * Called when the entity is spawned in a castle as lord
 */
public void makeCastleLord(@NonNull CastlePositionData.Position pos){
  Logger.d(TAG,"String_Node_Str");
  ChunkCoordIntPair lc=pos.getLowerMainCastle();
  ChunkCoordIntPair uc=pos.getUpperMainCastle();
  if (lc == null || uc == null) {
    Logger.w(TAG,"String_Node_Str",pos);
    return;
  }
  this.setHome(AxisAlignedBB.getBoundingBox(lc.chunkXPos << 4,pos.getHeight() - 1,lc.chunkZPos << 4,(uc.chunkXPos << 4) + 15,pos.getHeight() + 5,(uc.chunkZPos << 4) + 15));
}
Program: 12710
Project: 12710
Buggy source:
/** 
 * Loads all tiles from the jar
 */
public static void loadTiles(){
  Gson gson=new GsonBuilder().setPrettyPrinting().registerTypeAdapterFactory(ModdedEnumTypeAdapter.ENUM_FACTORY).create();
  tileMap=new HashMap<String,BuildingTile>();
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
}

Fixed version (ground truth):
/** 
 * Loads all tiles from the jar
 */
public static void loadTiles(){
  Gson gson=new GsonBuilder().setPrettyPrinting().registerTypeAdapterFactory(ModdedEnumTypeAdapter.ENUM_FACTORY).create();
  tileMap=new HashMap<String,BuildingTile>();
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
  loadTile("String_Node_Str",gson,tileMap);
}
Program: 12711
Project: 12711
Buggy source:
@SubscribeEvent public void onEntityJoinWorld(EntityJoinWorldEvent event){
  if (event.entity instanceof EntityPlayer) {
    if (event.entity.worldObj.isRemote) {
      VampirismMod.modChannel.sendToServer(new RequestEntityUpdatePacket(event.entity));
    }
 else {
      VampirePlayer.onPlayerJoinWorld((EntityPlayer)event.entity);
    }
  }
}

Fixed version (ground truth):
@SubscribeEvent public void onEntityJoinWorld(EntityJoinWorldEvent event){
  if (event.entity instanceof EntityPlayer) {
    if (event.entity.worldObj.isRemote || event.entity instanceof EntityClientPlayerMP) {
      VampirismMod.modChannel.sendToServer(new RequestEntityUpdatePacket(event.entity));
    }
 else {
      VampirePlayer.onPlayerJoinWorld((EntityPlayer)event.entity);
    }
  }
}
Program: 12712
Project: 12712
Buggy source:
@SubscribeEvent public void onLivingUpdate(LivingUpdateEvent event){
  if (event.entity instanceof EntityPlayer) {
    VampirePlayer.get((EntityPlayer)event.entity).onUpdate();
    ;
  }
}

Fixed version (ground truth):
@SubscribeEvent public void onLivingUpdate(LivingUpdateEvent event){
  if (event.entity instanceof EntityPlayer) {
    VampirePlayer.get((EntityPlayer)event.entity).onUpdate();
  }
}
Program: 12714
Project: 12714
Buggy source:
/** 
 * Teleports dracula randomly 
 */
private boolean teleportRandomly(){
  double d0=this.posX + (this.rand.nextDouble() - 0.5D) * maxTeleportDistanceX;
  double d1=this.posY + (this.rand.nextInt((int)(maxTeleportDistanceY * 1.5)) - maxTeleportDistanceY * 0.5D);
  double d2=this.posZ + (this.rand.nextDouble() - 0.5D) * maxTeleportDistanceZ;
  if (this.isWithinHomeDistance(MathHelper.floor_double(d0),MathHelper.floor_double(d1),MathHelper.floor_double(d2))) {
    if (Helper.teleportTo(this,d0,d1,d2,true)) {
      if (rand.nextInt(10) == 0) {
        this.addPotionEffect(new PotionEffect(Potion.invisibility.id,60));
        this.addPotionEffect(new PotionEffect(Potion.regeneration.id,60,2));
        this.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id,60,2));
        summonBats();
      }
      return true;
    }
  }
  if (rand.nextBoolean()) {
    this.teleportRandomly();
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Teleports dracula randomly 
 */
private boolean teleportRandomly(){
  if (teleportDelay > 0)   return false;
  double d0=this.posX + (this.rand.nextDouble() - 0.5D) * maxTeleportDistanceX;
  double d1=this.posY + (this.rand.nextInt((int)(maxTeleportDistanceY * 1.5)) - maxTeleportDistanceY * 0.5D);
  double d2=this.posZ + (this.rand.nextDouble() - 0.5D) * maxTeleportDistanceZ;
  if (this.isWithinHomeDistance(MathHelper.floor_double(d0),MathHelper.floor_double(d1),MathHelper.floor_double(d2))) {
    if (Helper.teleportTo(this,d0,d1,d2,true)) {
      if (rand.nextInt(10) == 0) {
        this.addPotionEffect(new PotionEffect(Potion.invisibility.id,60));
        this.addPotionEffect(new PotionEffect(Potion.regeneration.id,60,2));
        this.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id,60,2));
        summonBats();
      }
      teleportDelay=TELEPORT_DELAY;
      return true;
    }
  }
  if (rand.nextBoolean()) {
    this.teleportRandomly();
  }
  return false;
}
Program: 12715
Project: 12715
Buggy source:
@Override public void onDeath(DamageSource s){
  if (this.recentlyHit > 0 && this.worldObj.getGameRules().getGameRuleBooleanValue("String_Node_Str")) {
    if (level > 0 && level < 6) {
      this.entityDropItem(new ItemStack(ModItems.pureBlood,1,level - 1),0.3F);
    }
 else     if (level > 5) {
      this.entityDropItem(new ItemStack(ModItems.pureBlood,1,4),0.3F);
    }
  }
}

Fixed version (ground truth):
@Override public void onDeath(DamageSource s){
  super.onDeath(s);
  if (this.recentlyHit > 0 && this.worldObj.getGameRules().getGameRuleBooleanValue("String_Node_Str")) {
    if (level > 0 && level < 6) {
      this.entityDropItem(new ItemStack(ModItems.pureBlood,1,level - 1),0.3F);
    }
 else     if (level > 5) {
      this.entityDropItem(new ItemStack(ModItems.pureBlood,1,4),0.3F);
    }
  }
}
Program: 12716
Project: 12716
Buggy source:
@Override public void onKillEntity(EntityLivingBase entity){
  super.onKillEntity(entity);
  if (entity instanceof EntityPlayer) {
    if (this.getLord() != null && this.getLord() instanceof EntityDracula) {
      ((EntityDracula)this.getLord()).restoreOnPlayerKill((EntityPlayer)entity);
    }
  }
}

Fixed version (ground truth):
@Override public void onKillEntity(EntityLivingBase entity){
  super.onKillEntity(entity);
  if (entity instanceof EntityPlayer) {
    if (this.getLord() != null && this.getLord() instanceof EntityDracula) {
      ((EntityDracula)this.getLord()).restoreOnPlayerKill((EntityPlayer)entity);
    }
  }
 else {
    if (this.getLord() != null && this.getLord() instanceof EntityVampireBaron) {
      ((EntityVampireBaron)this.getLord()).onKillEntity(entity);
    }
  }
}
Program: 12717
Project: 12717
Buggy source:
@Override public boolean canBeUsedBy(VampirePlayer vampire,EntityPlayer player){
  return !vampire.isSkillActive(Skills.batMode) && !vampire.isVampireLord();
}

Fixed version (ground truth):
@Override public boolean canBeUsedBy(VampirePlayer vampire,EntityPlayer player){
  return !vampire.isSkillActive(Skills.batMode);
}
Program: 12718
Project: 12718
Buggy source:
/** 
 * Generates entities
 * @param world World
 * @param random Random
 * @param x xCoord
 * @param z ZCoord
 */
private void addEntities(World world,Random random,int x,int z){
  try {
    int y=world.getHeightValue(x,z);
    Village v=world.villageCollectionObj.findNearestVillage(x,y,z,0);
    if (v == null) {
      return;
    }
    VillageVampire vv=VillageVampireData.get(world).getVillageVampire(v);
    if (vv == null)     return;
    int spawnedHunter=world.getEntitiesWithinAABB(EntityVampireHunter.class,vv.getBoundingBox()).size();
    for (    Entity e : Helper.spawnEntityInVillage(v,random.nextInt(3) - spawnedHunter,REFERENCE.ENTITY.VAMPIRE_HUNTER_NAME,world)) {
      ((EntityVampireHunter)e).setHomeArea(v.getCenter().posX,v.getCenter().posY,v.getCenter().posZ,v.getVillageRadius());
    }
  }
 catch (  Exception e) {
    return;
  }
}

Fixed version (ground truth):
/** 
 * Generates entities
 * @param world World
 * @param random Random
 * @param x xCoord
 * @param z ZCoord
 */
private void addEntities(World world,Random random,int x,int z){
  if (world.provider.terrainType == WorldType.FLAT)   return;
  try {
    int y=world.getHeightValue(x,z);
    Village v=world.villageCollectionObj.findNearestVillage(x,y,z,0);
    if (v == null) {
      return;
    }
    VillageVampire vv=VillageVampireData.get(world).getVillageVampire(v);
    if (vv == null)     return;
    int spawnedHunter=world.getEntitiesWithinAABB(EntityVampireHunter.class,vv.getBoundingBox()).size();
    for (    Entity e : Helper.spawnEntityInVillage(v,random.nextInt(3) - spawnedHunter,REFERENCE.ENTITY.VAMPIRE_HUNTER_NAME,world)) {
      ((EntityVampireHunter)e).setHomeArea(v.getCenter().posX,v.getCenter().posY,v.getCenter().posZ,v.getVillageRadius());
    }
  }
 catch (  Exception e) {
    return;
  }
}
Program: 12721
Project: 12721
Buggy source:
@Override public void processCommand(ICommandSender sender,String[] param){
  if (param != null && param.length == 1 && sender instanceof EntityPlayer) {
    try {
      VampirePlayer.get((EntityPlayer)sender).setLevel(Integer.parseInt(param[0]));
      return;
    }
 catch (    NumberFormatException e) {
    }
  }
  super.processCommand(sender,param);
}

Fixed version (ground truth):
@Override public void processCommand(ICommandSender sender,String[] param){
  if (param != null && param.length == 1 && sender instanceof EntityPlayer) {
    try {
      VampirePlayer.get((EntityPlayer)sender).setLevel(Integer.parseInt(param[0]));
      MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText(sender.getCommandSenderName() + "String_Node_Str" + VampirePlayer.get((EntityPlayer)sender).getLevel()));
      return;
    }
 catch (    NumberFormatException e) {
    }
  }
  super.processCommand(sender,param);
}
Program: 12722
Project: 12722
Buggy source:
@SuppressWarnings("String_Node_Str") public BiomeVampireForest(int id){
  super(id);
  this.spawnableCreatureList.clear();
  this.spawnableMonsterList.clear();
  this.spawnableWaterCreatureList.clear();
  this.spawnableMonsterList.add(new SpawnListEntry(EntityGhost.class,10,3,5));
  this.spawnableMonsterList.add(new SpawnListEntry(EntityVampireBaron.class,1,1,1));
  this.spawnableMonsterList.add(new SpawnListEntry(EntityBlindingBat.class,1,4,8));
  this.spawnableMonsterList.add(new SpawnListEntry(EntityVampire.class,10,2,4));
  this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityDummyBittenAnimal.class,10,2,4));
  this.topBlock=ModBlocks.cursedEarth;
  this.fillerBlock=ModBlocks.cursedEarth;
  this.theBiomeDecorator.treesPerChunk=5;
  this.theBiomeDecorator.grassPerChunk=4;
  this.theBiomeDecorator.deadBushPerChunk=4;
  this.worldGeneratorTrees=new WorldGenTrees(false,4,1,0,false);
  this.flowers.clear();
  this.addFlower(ModBlocks.vampireFlower,1,10);
  this.canSpawnLightningBolt();
  this.waterColorMultiplier=0xFF2505;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public BiomeVampireForest(int id){
  super(id);
  this.spawnableCreatureList.clear();
  this.spawnableMonsterList.clear();
  this.spawnableWaterCreatureList.clear();
  this.spawnableMonsterList.add(new SpawnListEntry(EntityGhost.class,10,2,3));
  this.spawnableMonsterList.add(new SpawnListEntry(EntityVampireBaron.class,1,1,1));
  this.spawnableMonsterList.add(new SpawnListEntry(EntityBlindingBat.class,3,4,8));
  this.spawnableMonsterList.add(new SpawnListEntry(EntityVampire.class,10,2,3));
  this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityDummyBittenAnimal.class,10,3,5));
  this.topBlock=ModBlocks.cursedEarth;
  this.fillerBlock=ModBlocks.cursedEarth;
  this.theBiomeDecorator.treesPerChunk=5;
  this.theBiomeDecorator.grassPerChunk=4;
  this.theBiomeDecorator.deadBushPerChunk=4;
  this.worldGeneratorTrees=new WorldGenTrees(false,4,1,0,false);
  this.flowers.clear();
  this.addFlower(ModBlocks.vampireFlower,1,10);
  this.canSpawnLightningBolt();
  this.waterColorMultiplier=0xFF2505;
}
Program: 12723
Project: 12723
Buggy source:
@Override public void actionPerformed(GuiButton button){
  if (button.id == 0) {
    GuiEntry e=new GuiEntry(book,category,from,player,bookStack);
    e.pageNumber=fromPage;
    Minecraft.getMinecraft().displayGuiScreen(e);
  }
 else {
    super.actionPerformed(button);
  }
}

Fixed version (ground truth):
@SideOnly(Side.CLIENT) @Override public void actionPerformed(GuiButton button){
  if (button.id == 0) {
    GuiEntry e=new GuiEntry(book,category,from,player,bookStack);
    e.pageNumber=fromPage;
    Minecraft.getMinecraft().displayGuiScreen(e);
  }
 else {
    super.actionPerformed(button);
  }
}
Program: 12724
Project: 12724
Buggy source:
public static ResourceLocation getTexture(int i){
switch (i) {
case 0:
    return texture1;
case 1:
  return texture2;
case 2:
return texture3;
}
return texture;
}

Fixed version (ground truth):
public static ResourceLocation getTexture(int i){
switch (i) {
case 0:
    return texture1;
case 1:
  return texture2;
case 2:
return texture3;
case 3:
return texture4;
}
return texture;
}
Program: 12725
Project: 12725
Buggy source:
@Override protected ResourceLocation getEntityTexture(Entity entity){
  int i=entity.getEntityId() % 4;
  return getTexture(i);
}

Fixed version (ground truth):
@Override protected ResourceLocation getEntityTexture(Entity entity){
  int i=entity.getEntityId() % 5;
  return getTexture(i);
}