nus-yam/ex-repair huggingface dataset:
Program: 34734
Project: 34734
Buggy source:
protected IslandBiomeEnchantedIsland(int biomeID){
  super(biomeID);
  contentVariations.add(HOMELAND);
  contentVariations.add(LABORATORY);
  randomDeviations.add(TALL_PILES);
  getSpawnEntries(HOMELAND).addAll(new SpawnEntry[]{new SpawnEntry(EntityEnderman.class,22,38),new SpawnEntry(EntityMobBabyEnderman.class,14,20)});
  getSpawnEntries(LABORATORY).addAll(new SpawnEntry[]{new SpawnEntry(EntityMobEndermage.class,6,15),new SpawnEntry(EntityEnderman.class,12,10),new SpawnEntry(EntityMobEnderGuardian.class,20,7)});
  getInteractions(HOMELAND).addAll(new BiomeInteraction[]{new BiomeInteraction("String_Node_Str",InteractionOvertake.class,50,1),new BiomeInteraction("String_Node_Str",InteractionCellarSounds.class,10,20)});
  getInteractions(LABORATORY).addAll(new BiomeInteraction[]{new BiomeInteraction("String_Node_Str",InteractionCellarSounds.class,10,20)});
}

Fixed version (ground truth):
protected IslandBiomeEnchantedIsland(int biomeID){
  super(biomeID);
  contentVariations.add(HOMELAND);
  randomDeviations.add(TALL_PILES);
  getSpawnEntries(HOMELAND).addAll(new SpawnEntry[]{new SpawnEntry(EntityEnderman.class,22,38),new SpawnEntry(EntityMobBabyEnderman.class,14,20)});
  getInteractions(HOMELAND).addAll(new BiomeInteraction[]{new BiomeInteraction("String_Node_Str",InteractionOvertake.class,50,1),new BiomeInteraction("String_Node_Str",InteractionCellarSounds.class,10,20)});
}
Program: 34735
Project: 34735
Buggy source:
@Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister){
  ((TextureMap)iconRegister).setTextureEntry("String_Node_Str",(TextureAtlasSprite)(itemIcon=new TextureBiomeCompass("String_Node_Str")));
  if (locations == null) {
    locations=new ArrayList<>(IslandBiomeBase.biomeList.size());
    for (int a=0; a < IslandBiomeBase.biomeList.size(); a++)     locations.add(a,new HashSet<ChunkCoordinates>());
    lastSavedX=lastSavedZ=Integer.MAX_VALUE;
  }
}

Fixed version (ground truth):
@Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister){
  ((TextureMap)iconRegister).setTextureEntry("String_Node_Str",(TextureAtlasSprite)(itemIcon=new TextureBiomeCompass("String_Node_Str")));
  locations=new ArrayList<>(IslandBiomeBase.biomeList.size());
  for (int a=0; a < IslandBiomeBase.biomeList.size(); a++)   locations.add(a,new HashSet<ChunkCoordinates>());
  lastSavedX=lastSavedZ=Integer.MAX_VALUE;
  Log.info("String_Node_Str");
}
Program: 34737
Project: 34737
Buggy source:
@Override public ItemStack onItemRightClick(ItemStack is,World world,EntityPlayer player){
  if (is.getItemDamage() < getMaxDamage()) {
    if (!world.isRemote) {
      is.setItemDamage(is.getItemDamage() + getEnergyPerUse(is));
      world.spawnEntityInWorld(new EntityProjectileSpatialDash(world,player));
    }
 else     world.playSound(player.posX,player.posY,player.posZ,"String_Node_Str",0.8F,0.9F,false);
  }
  return is;
}

Fixed version (ground truth):
@Override public ItemStack onItemRightClick(ItemStack is,World world,EntityPlayer player){
  if (is.getItemDamage() < getMaxDamage()) {
    if (!world.isRemote) {
      is.damageItem(getEnergyPerUse(is),player);
      world.spawnEntityInWorld(new EntityProjectileSpatialDash(world,player));
    }
 else     world.playSound(player.posX,player.posY,player.posZ,"String_Node_Str",0.8F,0.9F,false);
  }
  return is;
}
Program: 34738
Project: 34738
Buggy source:
public ItemStack tryTeleportEntity(ItemStack is,EntityPlayer player,Entity entity){
  if (entity.isRiding() || entity.riddenByEntity != null)   return is;
  GemData gemData=GemData.loadFromItemStack(is);
  if (gemData.isLinked() && entity.dimension == gemData.getDimension()) {
    int itemDamage=is.getItemDamage();
    if (itemDamage >= is.getMaxDamage())     return is;
    boolean isLiving=entity instanceof EntityLivingBase;
    PacketPipeline.sendToAllAround(entity,64D,new C21EffectEntity(FXType.Entity.GEM_TELEPORT_FROM,entity));
    is.setItemDamage(itemDamage + getEnergyPerUse(is));
    entity.fallDistance=0F;
    if (isLiving)     ((EntityLivingBase)entity).setPositionAndUpdate(gemData.getX() + 0.5D,gemData.getY() + 1.001D,gemData.getZ() + 0.5D);
    entity.setLocationAndAngles(gemData.getX() + 0.5D,gemData.getY() + 1.001D,gemData.getZ() + 0.5D,entity.rotationYaw,entity.rotationPitch);
    float percBroken=itemDamage / (float)is.getMaxDamage();
    if (percBroken > 0.66F && entity.worldObj.rand.nextFloat() * 1.4F < percBroken) {
      GemSideEffects.performRandomEffect(entity,percBroken);
    }
    if (EnhancementHandler.hasEnhancement(is,TransferenceGemEnhancements.HEAL) && isLiving) {
      EntityLivingBase e=(EntityLivingBase)entity;
      e.addPotionEffect(new PotionEffect(Potion.regeneration.id,120,1,true));
      e.addPotionEffect(new PotionEffect(Potion.field_76443_y.id,1,0,true));
      e.extinguish();
    }
    PacketPipeline.sendToAllAround(entity,64D,new C20Effect(FXType.Basic.GEM_TELEPORT_TO,entity));
  }
  return is;
}

Fixed version (ground truth):
public ItemStack tryTeleportEntity(ItemStack is,EntityPlayer player,Entity entity){
  if (entity.isRiding() || entity.riddenByEntity != null)   return is;
  GemData gemData=GemData.loadFromItemStack(is);
  if (gemData.isLinked() && entity.dimension == gemData.getDimension()) {
    int itemDamage=is.getItemDamage();
    if (itemDamage >= is.getMaxDamage())     return is;
    boolean isLiving=entity instanceof EntityLivingBase;
    PacketPipeline.sendToAllAround(entity,64D,new C21EffectEntity(FXType.Entity.GEM_TELEPORT_FROM,entity));
    is.damageItem(getEnergyPerUse(is),player);
    if (isLiving)     ((EntityLivingBase)entity).setPositionAndUpdate(gemData.getX() + 0.5D,gemData.getY() + 1.001D,gemData.getZ() + 0.5D);
    entity.setLocationAndAngles(gemData.getX() + 0.5D,gemData.getY() + 1.001D,gemData.getZ() + 0.5D,entity.rotationYaw,entity.rotationPitch);
    entity.fallDistance=0F;
    float percBroken=itemDamage / (float)is.getMaxDamage();
    if (percBroken > 0.66F && entity.worldObj.rand.nextFloat() * 1.4F < percBroken) {
      GemSideEffects.performRandomEffect(entity,percBroken);
    }
    if (EnhancementHandler.hasEnhancement(is,TransferenceGemEnhancements.HEAL) && isLiving) {
      EntityLivingBase e=(EntityLivingBase)entity;
      e.addPotionEffect(new PotionEffect(Potion.regeneration.id,120,1,true));
      e.addPotionEffect(new PotionEffect(Potion.field_76443_y.id,1,0,true));
      e.extinguish();
    }
    PacketPipeline.sendToAllAround(entity,64D,new C20Effect(FXType.Basic.GEM_TELEPORT_TO,entity));
  }
  return is;
}
Program: 34739
Project: 34739
Buggy source:
public static <K,V extends Comparable<? super V>>SortedSet<Entry<K,V>> sortMapByValueAscending(Map<K,V> map){
  SortedSet<Entry<K,V>> sorted=new TreeSet<>(new Comparator<Entry<K,V>>(){
    @Override public int compare(    Entry<K,V> e1,    Entry<K,V> e2){
      int r=e1.getValue().compareTo(e2.getValue());
      return r == 0 ? 1 : r;
    }
  }
);
  sorted.addAll(map.entrySet());
  return sorted;
}

Fixed version (ground truth):
public static <K,V extends Comparable<? super V>>SortedSet<Entry<K,V>> sortMapByValueAscending(Map<K,V> map){
  SortedSet<Entry<K,V>> sorted=new TreeSet<>(new Comparator<Entry<K,V>>(){
    @Override public int compare(    Entry<K,V> e1,    Entry<K,V> e2){
      int r=e1.getValue().compareTo(e2.getValue());
      return r == 0 ? 1 : r;
    }
  }
);
  for (  Entry<K,V> entry : map.entrySet())   sorted.add(new SimpleEntry(entry));
  return sorted;
}
Program: 34740
Project: 34740
Buggy source:
public static <K,V extends Comparable<? super V>>SortedSet<Entry<K,V>> sortMapByValueDescending(Map<K,V> map){
  SortedSet<Entry<K,V>> sorted=new TreeSet<>(new Comparator<Entry<K,V>>(){
    @Override public int compare(    Entry<K,V> e1,    Entry<K,V> e2){
      int r=e2.getValue().compareTo(e1.getValue());
      return r == 0 ? 1 : r;
    }
  }
);
  sorted.addAll(map.entrySet());
  return sorted;
}

Fixed version (ground truth):
public static <K,V extends Comparable<? super V>>SortedSet<Entry<K,V>> sortMapByValueDescending(Map<K,V> map){
  SortedSet<Entry<K,V>> sorted=new TreeSet<>(new Comparator<Entry<K,V>>(){
    @Override public int compare(    Entry<K,V> e1,    Entry<K,V> e2){
      int r=e2.getValue().compareTo(e1.getValue());
      return r == 0 ? 1 : r;
    }
  }
);
  for (  Entry<K,V> entry : map.entrySet())   sorted.add(new SimpleEntry(entry));
  return sorted;
}
Program: 34741
Project: 34741
Buggy source:
public BiomeDecoratorHardcoreEnd(){
  spikeGen=new WorldGenSpikes();
  blobGen=new WorldGenBlob();
  meteoroidGen=new WorldGenMeteoroid();
  endPowderOreGen=new WorldGenEndPowderOre();
  endiumOreGen=new WorldGenEndiumOre();
}

Fixed version (ground truth):
public BiomeDecoratorHardcoreEnd(){
  spikeGen=new WorldGenObsidianSpike();
  blobGen=new WorldGenBlob();
  meteoroidGen=new WorldGenMeteoroid();
  endPowderOreGen=new WorldGenEndPowderOre();
  endiumOreGen=new WorldGenEndiumOre();
}
Program: 34742
Project: 34742
Buggy source:
private boolean shouldActHostile(){
  if (homelandRole == HomelandRole.ISLAND_LEADERS || (groupId != -1 && rand.nextInt(5) != 0) || HomelandEndermen.isOvertakeHappening(this)) {
    return false;
  }
 else   return rand.nextInt(4) != 0;
}

Fixed version (ground truth):
private boolean shouldActHostile(){
  if (homelandRole == HomelandRole.ISLAND_LEADERS || (groupId != -1 && rand.nextInt(5) != 0) || HomelandEndermen.isOvertakeHappening(this)) {
    return false;
  }
 else   return rand.nextInt(3) != 0;
}
Program: 34743
Project: 34743
Buggy source:
@Override public void readEntityFromNBT(NBTTagCompound nbt){
  super.readEntityFromNBT(nbt);
  byte homelandRoleId=nbt.getByte("String_Node_Str");
  homelandRole=homelandRoleId >= 0 && homelandRoleId < HomelandRole.values.length ? HomelandRole.values[homelandRoleId] : null;
  if ((groupId=nbt.getLong("String_Node_Str")) != -1) {
    byte groupRoleId=nbt.getByte("String_Node_Str");
    overtakeGroupRole=groupRoleId >= 0 && groupRoleId < OvertakeGroupRole.values.length ? OvertakeGroupRole.values[groupRoleId] : null;
  }
  if (groupId != -1 && overtakeGroupRole == null) {
    Log.warn("String_Node_Str");
    groupId=-1;
  }
  if (nbt.hasKey("String_Node_Str")) {
    currentTask=EndermanTask.WAIT;
    currentTaskTimer=nbt.getInteger("String_Node_Str");
  }
  if (nbt.hasKey("String_Node_Str"))   setCarrying(ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("String_Node_Str")));
  if (homelandRole == null || (groupId != -1 && overtakeGroupRole == null))   setDead();
 else   if (!worldObj.isRemote)   refreshRoles();
}

Fixed version (ground truth):
@Override public void readEntityFromNBT(NBTTagCompound nbt){
  super.readEntityFromNBT(nbt);
  byte homelandRoleId=nbt.getByte("String_Node_Str");
  homelandRole=homelandRoleId >= 0 && homelandRoleId < HomelandRole.values.length ? HomelandRole.values[homelandRoleId] : null;
  if ((groupId=nbt.getLong("String_Node_Str")) != -1) {
    byte groupRoleId=nbt.getByte("String_Node_Str");
    overtakeGroupRole=groupRoleId >= 0 && groupRoleId < OvertakeGroupRole.values.length ? OvertakeGroupRole.values[groupRoleId] : null;
  }
  if (groupId != -1 && overtakeGroupRole == null) {
    Log.warn("String_Node_Str");
    groupId=-1;
  }
  if (nbt.hasKey("String_Node_Str")) {
    currentTask=EndermanTask.WAIT;
    currentTaskTimer=nbt.getInteger("String_Node_Str");
    posY=10000D;
  }
 else   if (nbt.hasKey("String_Node_Str")) {
    currentTask=EndermanTask.GET_TNT;
    currentTaskTimer=nbt.getInteger("String_Node_Str");
    posY=10000D;
  }
  if (nbt.hasKey("String_Node_Str"))   setCarrying(ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("String_Node_Str")));
  if (homelandRole == null || (groupId != -1 && overtakeGroupRole == null))   setDead();
 else   if (!worldObj.isRemote)   refreshRoles();
}
Program: 34744
Project: 34744
Buggy source:
@Override public void setTarget(Entity target){
  super.setTarget(target);
  if (entityToAttack != null)   resetTask();
}

Fixed version (ground truth):
@Override public void setTarget(Entity target){
  super.setTarget(target);
  if (entityToAttack != null) {
    resetTask();
    setPathToEntity(worldObj.getPathEntityToEntity(this,entityToAttack,16F,true,false,false,true));
  }
}
Program: 34745
Project: 34745
Buggy source:
@Override public void writeEntityToNBT(NBTTagCompound nbt){
  super.writeEntityToNBT(nbt);
  nbt.setByte("String_Node_Str",(byte)homelandRole.ordinal());
  nbt.setLong("String_Node_Str",groupId);
  if (groupId != -1)   nbt.setByte("String_Node_Str",(byte)overtakeGroupRole.ordinal());
  if (currentTask == EndermanTask.WAIT)   nbt.setInteger("String_Node_Str",currentTaskTimer);
  ItemStack carrying=getCarrying();
  if (carrying != null)   nbt.setTag("String_Node_Str",carrying.writeToNBT(new NBTTagCompound()));
}

Fixed version (ground truth):
@Override public void writeEntityToNBT(NBTTagCompound nbt){
  super.writeEntityToNBT(nbt);
  nbt.setByte("String_Node_Str",(byte)homelandRole.ordinal());
  nbt.setLong("String_Node_Str",groupId);
  if (groupId != -1)   nbt.setByte("String_Node_Str",(byte)overtakeGroupRole.ordinal());
  if (currentTask == EndermanTask.WAIT)   nbt.setInteger("String_Node_Str",currentTaskTimer);
 else   if (currentTask == EndermanTask.GET_TNT)   nbt.setInteger("String_Node_Str",currentTaskTimer);
  ItemStack carrying=getCarrying();
  if (carrying != null)   nbt.setTag("String_Node_Str",carrying.writeToNBT(new NBTTagCompound()));
}
Program: 34747
Project: 34747
Buggy source:
@Override protected Entity findPlayerToAttack(){
  EntityPlayer closestPlayer=worldObj.getClosestPlayerToEntity(this,64D);
  if (closestPlayer != null) {
    if (isPlayerStaringIntoEyes(closestPlayer)) {
      if (!shouldActHostile() && teleportRandomly())       return null;
      if (stareTimer == 0)       worldObj.playSoundEffect(closestPlayer.posX,closestPlayer.posY,closestPlayer.posZ,"String_Node_Str",1F,1F);
 else       if (stareTimer++ == 5) {
        stareTimer=0;
        setScreaming(true);
        return closestPlayer;
      }
    }
 else     stareTimer=0;
  }
  return null;
}

Fixed version (ground truth):
@Override protected Entity findPlayerToAttack(){
  if (worldObj.isRemote)   return null;
  List<EntityPlayerMP> players=worldObj.playerEntities;
  for (  EntityPlayerMP player : players) {
    if (player.theItemInWorldManager.getGameType().isSurvivalOrAdventure() && getDistanceSqToEntity(player) <= 4096D) {
      if (isPlayerStaringIntoEyes(player)) {
        if (!shouldActHostile() && teleportRandomly())         return null;
        if (stareTimer == 0)         worldObj.playSoundEffect(posX,posY,posZ,"String_Node_Str",1F,1F);
 else         if (stareTimer++ == 5) {
          stareTimer=0;
          setScreaming(true);
          setTarget(player);
          return null;
        }
      }
 else       stareTimer=0;
    }
  }
  return null;
}
Program: 34748
Project: 34748
Buggy source:
public void renderEnderman(IEndermanRenderer entity,double x,double y,double z,float yaw,float partialTickTime){
  endermanModel.isCarrying=false;
  endermanModel.isAttacking=entity.isScreaming();
  if (entity.isScreaming()) {
    double spazzAmount=0.02D;
    x+=rand.nextGaussian() * spazzAmount;
    z+=rand.nextGaussian() * spazzAmount;
  }
  superDoRender(entity,x,y,z,yaw,partialTickTime);
}

Fixed version (ground truth):
public void renderEnderman(IEndermanRenderer entity,double x,double y,double z,float yaw,float partialTickTime){
  endermanModel.isCarrying=entity.isCarrying();
  endermanModel.isAttacking=entity.isScreaming();
  if (entity.isScreaming()) {
    double spazzAmount=0.02D;
    x+=rand.nextGaussian() * spazzAmount;
    z+=rand.nextGaussian() * spazzAmount;
  }
  superDoRender(entity,x,y,z,yaw,partialTickTime);
}
Program: 34752
Project: 34752
Buggy source:
@Override public boolean mouseClicked(GuiContainer gui,int mouseX,int mouseY,int button){
  if (button == 0 || button == 1) {
    return handleItemStack(GuiContainerManager.getStackMouseOver(gui));
  }
 else   return false;
}

Fixed version (ground truth):
@Override public boolean mouseClicked(GuiContainer gui,int mouseX,int mouseY,int button){
  if (button == 0 || button == 1) {
    if (gui instanceof GuiRecipe)     return handleItemStack(GuiContainerManager.getStackMouseOver(gui));
 else     return handleItemStack(LayoutManager.itemPanel.getStackMouseOver(mouseX,mouseY));
  }
 else   return false;
}
Program: 34755
Project: 34755
Buggy source:
@Override public void setDead(){
  if (overrideDeath) {
    ChunkCoordinates coords=WorldDataHandler.<DragonSavefile>get(DragonSavefile.class).getPortalEggLocation();
    DimensionManager.getWorld(1).setBlock(coords.posX,coords.posY,coords.posZ,Blocks.dragon_egg);
  }
  super.setDead();
}

Fixed version (ground truth):
@Override public void setDead(){
  if (overrideDeath) {
    DragonSavefile file=WorldDataHandler.get(DragonSavefile.class);
    if (file.isDragonDead()) {
      ChunkCoordinates coords=file.getPortalEggLocation();
      DimensionManager.getWorld(1).setBlock(coords.posX,coords.posY,coords.posZ,Blocks.dragon_egg);
    }
  }
  super.setDead();
}
Program: 34756
Project: 34756
Buggy source:
@Override protected void writeEntityToNBT(NBTTagCompound nbt){
  if (interaction != null) {
    NBTTagCompound tag=new NBTTagCompound();
    interaction.saveToNBT(tag);
    nbt.setTag("String_Node_Str",tag);
  }
}

Fixed version (ground truth):
@Override protected void writeEntityToNBT(NBTTagCompound nbt){
  if (!worldObj.isRemote) {
    NBTTagCompound tag=new NBTTagCompound();
    interaction.saveToNBT(tag);
    nbt.setTag("String_Node_Str",tag);
    nbt.setString("String_Node_Str",interaction.getIdentifier());
  }
}
Program: 34757
Project: 34757
Buggy source:
@Override protected void readEntityFromNBT(NBTTagCompound nbt){
  if (interaction != null)   interaction.loadFromNBT(nbt.getCompoundTag("String_Node_Str"));
}

Fixed version (ground truth):
@Override protected void readEntityFromNBT(NBTTagCompound nbt){
  if (!worldObj.isRemote) {
    interaction=BiomeInteraction.createByIdentifier(nbt.getString("String_Node_Str"));
    if (interaction != null) {
      interaction.init(this);
      interaction.init();
      interaction.loadFromNBT(nbt.getCompoundTag("String_Node_Str"));
    }
 else     setDead();
  }
}
Program: 34758
Project: 34758
Buggy source:
@Override protected void entityInit(){
  if (interaction != null)   interaction.init(this);
}

Fixed version (ground truth):
@Override protected void entityInit(){
}
Program: 34759
Project: 34759
Buggy source:
@Override public void onUpdate(){
  if (interaction != null)   interaction.update();
}

Fixed version (ground truth):
@Override public void onUpdate(){
  if (!worldObj.isRemote)   interaction.update();
}
Program: 34760
Project: 34760
Buggy source:
public EntityTechnicalBiomeInteraction(World world,double x,double y,double z,AbstractBiomeInteraction interaction){
  super(world);
  setPosition(x,y,z);
  this.interaction=interaction;
}

Fixed version (ground truth):
public EntityTechnicalBiomeInteraction(World world,double x,double y,double z,AbstractBiomeInteraction interaction){
  super(world);
  setPosition(x,y,z);
  this.interaction=interaction;
  this.interaction.init(this);
  this.interaction.init();
}
Program: 34762
Project: 34762
Buggy source:
public static <T>T get(Class<? extends WorldSavefile> cls){
  Stopwatch.timeAverage("String_Node_Str",128);
  WorldSavefile savefile=instance.cache.get(cls);
  if (savefile == null) {
    try {
      instance.cache.put(cls,savefile=cls.newInstance());
      File file=new File(instance.worldSaveDir,savefile.filename);
      if (file.exists()) {
        try {
          savefile.loadFromNBT(CompressedStreamTools.readCompressed(new FileInputStream(file)));
        }
 catch (        IOException ioe) {
          Log.throwable(ioe,"String_Node_Str",cls.getName());
        }
      }
 else       savefile.loadFromNBT(new NBTTagCompound());
    }
 catch (    InstantiationException|IllegalAccessException e) {
      throw new RuntimeException("String_Node_Str" + cls.getName(),e);
    }
  }
  Stopwatch.finish("String_Node_Str");
  return (T)savefile;
}

Fixed version (ground truth):
public static <T>T get(Class<? extends WorldSavefile> cls){
  Stopwatch.timeAverage("String_Node_Str",4096);
  WorldSavefile savefile=instance.cache.get(cls);
  if (savefile == null) {
    try {
      instance.cache.put(cls,savefile=cls.newInstance());
      File file=new File(instance.worldSaveDir,savefile.filename);
      if (file.exists()) {
        try {
          savefile.loadFromNBT(CompressedStreamTools.readCompressed(new FileInputStream(file)));
        }
 catch (        IOException ioe) {
          Log.throwable(ioe,"String_Node_Str",cls.getName());
        }
      }
 else       savefile.loadFromNBT(new NBTTagCompound());
    }
 catch (    InstantiationException|IllegalAccessException e) {
      throw new RuntimeException("String_Node_Str" + cls.getName(),e);
    }
  }
  Stopwatch.finish("String_Node_Str");
  return (T)savefile;
}
Program: 34763
Project: 34763
Buggy source:
@Override protected void onSave(NBTTagCompound nbt){
  for (TObjectIntIterator<UUID> iter=infestationPower.iterator(); iter.hasNext(); ) {
    nbt.setInteger(iter.key() + "String_Node_Str",iter.value());
  }
  for (TObjectByteIterator<UUID> iter=infestationTimer.iterator(); iter.hasNext(); ) {
    nbt.setByte(iter.key() + "String_Node_Str",iter.value());
  }
}

Fixed version (ground truth):
@Override protected void onSave(NBTTagCompound nbt){
  for (TObjectIntIterator<UUID> iter=infestationPower.iterator(); iter.hasNext(); ) {
    iter.advance();
    nbt.setInteger(iter.key() + "String_Node_Str",iter.value());
  }
  for (TObjectByteIterator<UUID> iter=infestationTimer.iterator(); iter.hasNext(); ) {
    iter.advance();
    nbt.setByte(iter.key() + "String_Node_Str",iter.value());
  }
}
Program: 34764
Project: 34764
Buggy source:
@Override protected void func_143011_b(NBTTagCompound nbt){
  super.func_143011_b(nbt);
  startX=nbt.getInteger("String_Node_Str");
  startZ=nbt.getInteger("String_Node_Str");
  islandBottomY=nbt.getByte("String_Node_Str");
  (structure=new LargeStructureWorld(this)).loadFromNBT(nbt.getCompoundTag("String_Node_Str"));
}

Fixed version (ground truth):
@Override protected void func_143011_b(NBTTagCompound nbt){
  super.func_143011_b(nbt);
  startX=nbt.getInteger("String_Node_Str");
  startZ=nbt.getInteger("String_Node_Str");
  islandBottomY=nbt.getByte("String_Node_Str");
  structure.loadFromNBT(nbt.getCompoundTag("String_Node_Str"));
}
Program: 34765
Project: 34765
Buggy source:
protected ComponentIsland(Random rand,int x,int z){
  super(rand,x,20,z,208,140,208);
  this.startX=x;
  this.startZ=z;
  coordBaseMode=0;
  boundingBox=new StructureBoundingBox(x,20,z,x + sizeX - 1,140 + sizeY - 1,z + sizeZ - 1);
}

Fixed version (ground truth):
protected ComponentIsland(Random rand,int x,int z){
  super(rand,x,20,z,208,140,208);
  this.startX=x;
  this.startZ=z;
  coordBaseMode=0;
  boundingBox=new StructureBoundingBox(x,20,z,x + sizeX - 1,140 + sizeY - 1,z + sizeZ - 1);
  structure=new LargeStructureWorld(this);
}
Program: 34767
Project: 34767
Buggy source:
protected IslandBiomeInfestedForest(int biomeID){
  super(biomeID);
  contentVariations.add(DEEP);
  contentVariations.add(RAVAGED);
  randomDeviations.add(TALL_TREES);
  randomDeviations.add(MORE_THORNY_BUSHES);
  getSpawnEntries(DEEP).addAll(new SpawnEntry[]{new SpawnEntry(EntitySilverfish.class,35,35),new SpawnEntry(EntityMobInfestedBat.class,8,10)});
  getInteractions(DEEP).addAll(new BiomeInteraction[]{new BiomeInteraction(InteractionCollapsingTrees.class,10)});
}

Fixed version (ground truth):
protected IslandBiomeInfestedForest(int biomeID){
  super(biomeID);
  contentVariations.add(DEEP);
  contentVariations.add(RAVAGED);
  randomDeviations.add(TALL_TREES);
  randomDeviations.add(MORE_THORNY_BUSHES);
  getSpawnEntries(DEEP).addAll(new SpawnEntry[]{new SpawnEntry(EntitySilverfish.class,35,35),new SpawnEntry(EntityMobInfestedBat.class,8,10)});
  getInteractions(DEEP).addAll(new BiomeInteraction[]{new BiomeInteraction("String_Node_Str",InteractionCollapsingTrees.class,10)});
}
Program: 34768
Project: 34768
Buggy source:
public AbstractBiomeInteraction create(){
  try {
    return interactionClass.newInstance();
  }
 catch (  InstantiationException|IllegalAccessException e) {
    Log.throwable(e,"String_Node_Str",interactionClass.getSimpleName());
    return null;
  }
}

Fixed version (ground truth):
public AbstractBiomeInteraction create(){
  try {
    AbstractBiomeInteraction interaction=interactionClass.newInstance();
    interaction.identifier=identifier;
    return interaction;
  }
 catch (  InstantiationException|IllegalAccessException e) {
    Log.throwable(e,"String_Node_Str",interactionClass.getSimpleName());
    return null;
  }
}
Program: 34769
Project: 34769
Buggy source:
public BiomeInteraction(Class<? extends AbstractBiomeInteraction> interactionClass,int weight){
  this.interactionClass=interactionClass;
  this.weight=weight;
}

Fixed version (ground truth):
public BiomeInteraction(String identifier,Class<? extends AbstractBiomeInteraction> interactionClass,int weight){
  this.identifier=identifier;
  this.interactionClass=interactionClass;
  this.weight=weight;
  idLookup.put(identifier,this);
}
Program: 34770
Project: 34770
Buggy source:
@Override public void init(){
  treesLeft=(byte)(1 + rand.nextInt(3 + rand.nextInt(4 + rand.nextInt(5))));
  for (int attempt=0; attempt < 32; attempt++) {
    x=centerX + rand.nextInt(ComponentIsland.size) - ComponentIsland.halfSize;
    z=centerZ + rand.nextInt(ComponentIsland.size) - ComponentIsland.halfSize;
    y=world.getHeightValue(x,z);
    boolean foundLog=false;
    for (int yy=y; yy > y - 10; yy--) {
      if (world.getBlock(x,y,z) == BlockList.spooky_log)       foundLog=true;
 else       if (foundLog) {
        attempt=33;
        y=yy + 1;
        break;
      }
    }
  }
}

Fixed version (ground truth):
@Override public void init(){
  treesLeft=(byte)(1 + rand.nextInt(3 + rand.nextInt(4 + rand.nextInt(5))));
  List<EntityPlayer> players=world.getEntitiesWithinAABB(EntityPlayer.class,AxisAlignedBB.getBoundingBox(centerX - ComponentIsland.halfSize,10,centerZ - ComponentIsland.halfSize,centerX + ComponentIsland.halfSize,120,centerZ + ComponentIsland.halfSize));
  if (players.isEmpty()) {
    entity.setDead();
    return;
  }
  byte dist=(byte)(8 + rand.nextInt(10 + rand.nextInt(15)));
  for (int attempt=0, amt=players.size(); attempt < 32; attempt++) {
    EntityPlayer player=players.get(rand.nextInt(amt));
    x=(int)player.posX + rand.nextInt(2 * dist) - dist;
    z=(int)player.posZ + rand.nextInt(2 * dist) - dist;
    y=world.getHeightValue(x,z);
    if (world.getClosestPlayer(x + 0.5D,y - 8,z + 0.5D,24D) == null)     continue;
    boolean foundLog=false;
    for (int yy=y; yy > y - 10; yy--) {
      if (world.getBlock(x,y,z) == BlockList.spooky_log)       foundLog=true;
 else       if (foundLog) {
        attempt=33;
        y=yy + 1;
        break;
      }
    }
  }
}
Program: 34771
Project: 34771
Buggy source:
@Override public void update(){
  if (--timer < 0) {
    if (world.getBlock(x,y,z) == BlockList.spooky_log) {
      if (rand.nextInt(8) == 0 && world.getGameRules().getGameRuleBooleanValue("String_Node_Str")) {
        EntityItem item=new EntityItem(world,x + rand.nextFloat() * 0.7F + 0.15F,y + rand.nextFloat() * 0.7F + 0.15F,z + rand.nextFloat() * 0.7F + 0.15F,new ItemStack(ItemList.dry_splinter));
        item.delayBeforeCanPickup=10;
        world.spawnEntityInWorld(item);
      }
      PacketPipeline.sendToAllAround(world.provider.dimensionId,x + 0.5D,y + 0.5D,z + 0.5D,64D,new C20Effect(FXType.Basic.SPOOKY_LOG_DECAY,x,y,z));
      world.setBlockToAir(x,y,z);
      ++y;
      timer=4;
    }
 else     if (--treesLeft <= 0) {
      entity.setDead();
      return;
    }
 else {
      for (int attempt=0, xx, yy, zz; attempt < 64; attempt++) {
        xx=x + rand.nextInt(14) - 7;
        zz=z + rand.nextInt(14) - 7;
        yy=world.getHeightValue(xx,zz);
        boolean foundLog=false;
        for (int yAttempt=0; yAttempt < 10; yAttempt++) {
          if (world.getBlock(xx,--yy,zz) == BlockList.spooky_log)           foundLog=true;
 else           if (foundLog) {
            attempt=65;
            x=xx;
            y=yy + 1;
            z=zz;
            break;
          }
        }
      }
    }
  }
  if (timer <= -1)   timer=(byte)(8 + rand.nextInt(10) + rand.nextInt(6) * rand.nextInt(4));
}

Fixed version (ground truth):
@Override public void update(){
  if (--timer < 0) {
    if (world.getBlock(x,y,z) == BlockList.spooky_log) {
      if (rand.nextInt(8) == 0 && world.getGameRules().getGameRuleBooleanValue("String_Node_Str")) {
        EntityItem item=new EntityItem(world,x + rand.nextFloat() * 0.7F + 0.15F,y + rand.nextFloat() * 0.7F + 0.15F,z + rand.nextFloat() * 0.7F + 0.15F,new ItemStack(ItemList.dry_splinter));
        item.delayBeforeCanPickup=10;
        world.spawnEntityInWorld(item);
      }
      world.playAuxSFX(2001,x,y,z,Block.getIdFromBlock(BlockList.spooky_log));
      world.setBlockToAir(x,y,z);
      ++y;
      timer=3;
    }
 else     if (--treesLeft <= 0) {
      entity.setDead();
      return;
    }
 else {
      for (int attempt=0, xx, yy, zz; attempt < 64; attempt++) {
        xx=x + rand.nextInt(10) - 5;
        zz=z + rand.nextInt(10) - 5;
        yy=world.getHeightValue(xx,zz);
        boolean foundLog=false;
        for (int yAttempt=0; yAttempt < 10; yAttempt++) {
          if (world.getBlock(xx,--yy,zz) == BlockList.spooky_log)           foundLog=true;
 else           if (foundLog) {
            attempt=65;
            x=xx;
            y=yy + 1;
            z=zz;
            break;
          }
        }
      }
    }
  }
  if (timer <= -1)   timer=(byte)(8 + rand.nextInt(10) + rand.nextInt(6) * rand.nextInt(4));
}
Program: 34772
Project: 34772
Buggy source:
public LargeStructureWorld(ComponentScatteredFeatureCustom structure){
  chunks=new LargeStructureChunk[structure.getSizeX() >> 4][structure.getSizeZ() >> 4];
  int chunkXSize=chunks.length, chunkZSize=chunks[0].length;
  for (int z=0; z < chunkZSize; z++) {
    for (int x=0; x < chunkXSize; x++) {
      chunks[x][z]=new LargeStructureChunk(x,z,structure.getSizeY());
    }
  }
}

Fixed version (ground truth):
public LargeStructureWorld(ComponentScatteredFeatureCustom structure){
  if (structure == null) {
    chunks=new LargeStructureChunk[0][0];
    return;
  }
  chunks=new LargeStructureChunk[structure.getSizeX() >> 4][structure.getSizeZ() >> 4];
  int chunkXSize=structure.getSizeX() >> 4, chunkZSize=structure.getSizeZ() >> 4;
  for (int z=0; z < chunkZSize; z++) {
    for (int x=0; x < chunkXSize; x++) {
      chunks[x][z]=new LargeStructureChunk(x,z,structure.getSizeY());
    }
  }
}
Program: 34774
Project: 34774
Buggy source:
public boolean tryDiscoverItem(KnowledgeObject<ObjectItem> item,boolean addReward){
  System.out.println("String_Node_Str" + item.getObject().getUnderlyingObject());
  if (discoveredItems.addObject(item.getObject())) {
    onDiscover(item,addReward);
    return true;
  }
 else   return false;
}

Fixed version (ground truth):
public boolean tryDiscoverItem(KnowledgeObject<ObjectItem> item,boolean addReward){
  if (discoveredItems.addObject(item.getObject())) {
    onDiscover(item,addReward);
    System.out.println("String_Node_Str" + item.getObject().getUnderlyingObject());
    return true;
  }
 else   return false;
}
Program: 34775
Project: 34775
Buggy source:
public boolean tryDiscoverMob(KnowledgeObject<ObjectMob> mob,boolean addReward){
  System.out.println("String_Node_Str" + mob.getObject().getUnderlyingObject().getSimpleName());
  if (discoveryMobs.addObject(mob.getObject())) {
    onDiscover(mob,addReward);
    return true;
  }
 else   return false;
}

Fixed version (ground truth):
public boolean tryDiscoverMob(KnowledgeObject<ObjectMob> mob,boolean addReward){
  if (discoveryMobs.addObject(mob.getObject())) {
    onDiscover(mob,addReward);
    System.out.println("String_Node_Str" + mob.getObject().getUnderlyingObject().getSimpleName());
    return true;
  }
 else   return false;
}
Program: 34776
Project: 34776
Buggy source:
public boolean tryDiscoverBlock(KnowledgeObject<ObjectBlock> block,boolean addReward){
  System.out.println("String_Node_Str" + block.getObject().getUnderlyingObject());
  if (discoveredBlocks.addObject(block.getObject())) {
    onDiscover(block,addReward);
    return true;
  }
 else   return false;
}

Fixed version (ground truth):
public boolean tryDiscoverBlock(KnowledgeObject<ObjectBlock> block,boolean addReward){
  if (discoveredBlocks.addObject(block.getObject())) {
    onDiscover(block,addReward);
    System.out.println("String_Node_Str" + block.getObject().getUnderlyingObject());
    return true;
  }
 else   return false;
}
Program: 34777
Project: 34777
Buggy source:
@Override public void onFinish(String identifier){
  totalTime+=TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startTime);
  if (--currentCounter == 0 && count > 0) {
    Log.debug("String_Node_Str",identifier,totalTime / count);
    currentCounter=count;
    totalTime=0L;
  }
}

Fixed version (ground truth):
@Override public void onFinish(String identifier){
  totalTime+=System.nanoTime() - startTime;
  if (--currentCounter == 0 && count > 0) {
    double time=(totalTime * toMillis) / count;
    Log.debug("String_Node_Str",identifier,Math.round(time),numberFormat.format(time));
    currentCounter=count;
    totalTime=0L;
  }
}
Program: 34778
Project: 34778
Buggy source:
private void updateLouseData(){
  if (worldObj == null || worldObj.isRemote || louseData == null)   return;
  getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(15D + 8D * louseData.attribute(EnumLouseAttribute.HEALTH));
  getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.7D + 0.06D * louseData.attribute(EnumLouseAttribute.SPEED));
  getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3D + 2.5D * louseData.attribute(EnumLouseAttribute.ATTACK));
  armorCapacity=(byte)MathUtil.square(louseData.attribute(EnumLouseAttribute.ARMOR));
  if (armorCapacity > 0)   armorCapacity*=6;
  dataWatcher.updateObject(16,louseData.serializeToString());
}

Fixed version (ground truth):
private void updateLouseData(){
  if (worldObj == null || worldObj.isRemote || louseData == null)   return;
  int attrSpeed=louseData.attribute(EnumLouseAttribute.SPEED);
  getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(12D + 10D * louseData.attribute(EnumLouseAttribute.HEALTH));
  getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.68D + (attrSpeed > 0 ? 0.08D + 0.05D * louseData.attribute(EnumLouseAttribute.SPEED) : 0D));
  getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(7D + 3.5D * louseData.attribute(EnumLouseAttribute.ATTACK));
  armorCapacity=(byte)MathUtil.square(louseData.attribute(EnumLouseAttribute.ARMOR));
  if (armorCapacity > 0)   armorCapacity*=5;
  dataWatcher.updateObject(16,louseData.serializeToString());
}
Program: 34779
Project: 34779
Buggy source:
private void teleport(int level){
  teleportTimer=(byte)(80 - level * 10);
}

Fixed version (ground truth):
private void teleport(int level){
  double oldPosX=posX;
  double oldPosY=posY;
  double oldPosZ=posZ;
  int maxDist=3 + level;
  boolean hasTeleported=false;
  for (int attempt=0, ix, iy, iz; attempt < 32 && !hasTeleported; attempt++) {
    posX=oldPosX + rand.nextInt(maxDist) - rand.nextInt(maxDist);
    posZ=oldPosZ + rand.nextInt(maxDist) - rand.nextInt(maxDist);
    ix=(int)Math.floor(posX);
    iy=(int)Math.floor(posY) + 1;
    iz=(int)Math.floor(posZ);
    for (int py=0; py < 3; py++) {
      if (worldObj.isAirBlock(ix,iy,iz) && !worldObj.isAirBlock(ix,iy - 1,iz)) {
        hasTeleported=true;
        break;
      }
 else       iy=(int)Math.floor(--posY) + 1;
    }
  }
  if (!hasTeleported)   return;
  teleportTimer=(byte)(80 - level * 10);
  for (int a=0; a < 64; a++) {
    worldObj.spawnParticle("String_Node_Str",oldPosX + (rand.nextDouble() - rand.nextDouble()) * width,oldPosY + rand.nextDouble() * height,oldPosZ + (rand.nextDouble() - rand.nextDouble()) * width,(rand.nextFloat() - 0.5F) * 0.2F,(rand.nextFloat() - 0.5F) * 0.2F,(rand.nextFloat() - 0.5F) * 0.2F);
  }
  worldObj.playSoundEffect(oldPosX,oldPosY,oldPosZ,"String_Node_Str",1F,1F);
  playSound("String_Node_Str",1F,1F);
}
Program: 34780
Project: 34780
Buggy source:
@Override public boolean attackEntityFrom(DamageSource source,float amount){
  int teleportLevel=louseData.attribute(EnumLouseAttribute.TELEPORT);
  if (teleportLevel > 0 && teleportTimer == 0) {
    teleport(teleportLevel);
    return false;
  }
  if (armor > 0F) {
    entityToAttack=source.getEntity();
    playSound("String_Node_Str",0.5F,1.2F);
    if ((armor-=amount) <= 0F)     armor=0F;
    armorRegenTimer=(byte)(100 - louseData.attribute(EnumLouseAttribute.ARMOR) * 15);
    return true;
  }
  return super.attackEntityFrom(source,amount);
}

Fixed version (ground truth):
@Override public boolean attackEntityFrom(DamageSource source,float amount){
  int teleportLevel=louseData.attribute(EnumLouseAttribute.TELEPORT);
  if (teleportLevel > 0 && teleportTimer == 0) {
    teleport(teleportLevel);
    return false;
  }
  if (armor > 0F && hurtResistantTime == 0) {
    entityToAttack=source.getEntity();
    playSound("String_Node_Str",0.5F,1.2F);
    if ((armor-=amount) <= 0F)     armor=0F;
    hurtTime=maxHurtTime=10;
    hurtResistantTime=10;
    return true;
  }
  armorRegenTimer=(byte)(100 - louseData.attribute(EnumLouseAttribute.ARMOR) * 15);
  return super.attackEntityFrom(source,amount);
}
Program: 34782
Project: 34782
Buggy source:
@Override protected AxisAlignedBB getSpawnerCheckBB(){
  int sx=getSpawnerX(), sy=getSpawnerY(), sz=getSpawnerZ();
  return AxisAlignedBB.getBoundingBox(sx,sy,sz,sx + 1,sy + 1,sz + 1).expand(spawnRange * 2D,0.5D,spawnRange * 2D);
}

Fixed version (ground truth):
@Override protected AxisAlignedBB getSpawnerCheckBB(){
  int sx=getSpawnerX(), sy=getSpawnerY(), sz=getSpawnerZ();
  return AxisAlignedBB.getBoundingBox(sx,sy,sz,sx + 1,sy + 1,sz + 1).expand(spawnRange * 2D,2.5D,spawnRange * 2D);
}
Program: 34783
Project: 34783
Buggy source:
@Override public void readFromNBT(NBTTagCompound nbt){
  super.readFromNBT(nbt);
  louseData=new LouseSpawnData(nbt.getCompoundTag("String_Node_Str"));
  System.out.println(louseData.serializeToString());
}

Fixed version (ground truth):
@Override public void readFromNBT(NBTTagCompound nbt){
  super.readFromNBT(nbt);
  louseData=new LouseSpawnData(nbt.getCompoundTag("String_Node_Str"));
}
Program: 34784
Project: 34784
Buggy source:
public LouseRavagedSpawnerLogic(TileEntityCustomSpawner spawnerTile){
  super(spawnerTile);
  this.minSpawnDelay=30;
  this.maxSpawnDelay=230;
  this.spawnRange=3;
  this.spawnCount=3;
  this.maxNearbyEntities=5;
  this.activatingRangeFromPlayer=16;
}

Fixed version (ground truth):
public LouseRavagedSpawnerLogic(TileEntityCustomSpawner spawnerTile){
  super(spawnerTile);
  this.minSpawnDelay=85;
  this.maxSpawnDelay=220;
  this.spawnRange=3;
  this.spawnCount=2;
  this.maxNearbyEntities=5;
  this.activatingRangeFromPlayer=12;
}
Program: 34785
Project: 34785
Buggy source:
@Override protected boolean checkSpawnerConditions(){
  int sx=getSpawnerX(), sy=getSpawnerY(), sz=getSpawnerZ();
  return getSpawnerWorld().getEntitiesWithinAABB(EntityMobLouse.class,AxisAlignedBB.getBoundingBox(sx,sy,sz,sx + 1,sy + 1,sz + 1).expand(8D,10D,8D)).size() <= 10;
}

Fixed version (ground truth):
@Override protected boolean checkSpawnerConditions(){
  int sx=getSpawnerX(), sy=getSpawnerY(), sz=getSpawnerZ();
  return getSpawnerWorld().getEntitiesWithinAABB(EntityMobLouse.class,AxisAlignedBB.getBoundingBox(sx,sy,sz,sx + 1,sy + 1,sz + 1).expand(10D,10D,10D)).size() <= 9;
}
Program: 34786
Project: 34786
Buggy source:
@Override protected boolean checkSpawnerConditions(){
  int sx=getSpawnerX(), sy=getSpawnerY(), sz=getSpawnerZ();
  return getSpawnerWorld().getEntitiesWithinAABB(EntitySilverfish.class,AxisAlignedBB.getBoundingBox(sx,sy,sz,sx + 1,sy + 1,sz + 1).expand(8D,10D,8D)).size() <= 10;
}

Fixed version (ground truth):
@Override protected boolean checkSpawnerConditions(){
  int sx=getSpawnerX(), sy=getSpawnerY(), sz=getSpawnerZ();
  return getSpawnerWorld().getEntitiesWithinAABB(EntitySilverfish.class,AxisAlignedBB.getBoundingBox(sx,sy,sz,sx + 1,sy + 1,sz + 1).expand(10D,10D,10D)).size() <= 10;
}
Program: 34787
Project: 34787
Buggy source:
public SilverfishRavagedSpawnerLogic(TileEntityCustomSpawner spawnerTile){
  super(spawnerTile);
  this.minSpawnDelay=50;
  this.maxSpawnDelay=200;
  this.spawnRange=4;
  this.spawnCount=2;
  this.maxNearbyEntities=5;
  this.activatingRangeFromPlayer=16;
}

Fixed version (ground truth):
public SilverfishRavagedSpawnerLogic(TileEntityCustomSpawner spawnerTile){
  super(spawnerTile);
  this.minSpawnDelay=120;
  this.maxSpawnDelay=220;
  this.spawnRange=4;
  this.spawnCount=2;
  this.maxNearbyEntities=5;
  this.activatingRangeFromPlayer=12;
}
Program: 34790
Project: 34790
Buggy source:
@Override public ItemStack processItem(ItemStack is,Random rand){
  if (is.getItem() == ItemList.enhanced_ender_pearl) {
    List<EnderPearlEnhancements> availableTypes=new ArrayList<>(Arrays.asList(EnderPearlEnhancements.values()));
    int amount=1 + (int)Math.abs(Math.round(rand.nextDouble() * rand.nextGaussian() * 2.25D));
    for (int a=0; a < amount; a++) {
      EnhancementHandler.addEnhancement(is,availableTypes.remove(rand.nextInt(availableTypes.size())));
      if (availableTypes.isEmpty())       break;
    }
  }
  return is;
}

Fixed version (ground truth):
@Override public ItemStack processItem(ItemStack is,Random rand){
  if (is.getItem() == ItemList.enhanced_ender_pearl) {
    List<EnderPearlEnhancements> availableTypes=new ArrayList<>(Arrays.asList(EnderPearlEnhancements.values()));
    int amount=1 + (int)Math.abs(Math.round(rand.nextDouble() * rand.nextGaussian() * 2.25D));
    for (int a=0; a < amount; a++) {
      is=EnhancementHandler.addEnhancement(is,availableTypes.remove(rand.nextInt(availableTypes.size())));
      if (availableTypes.isEmpty())       break;
    }
  }
  return is;
}
Program: 34791
Project: 34791
Buggy source:
@Override @SideOnly(Side.CLIENT) protected void handle(EntityClientPlayerMP player){
  String[] recordData=ItemMusicDisk.getRecordData(diskDamage);
  Minecraft mc=Minecraft.getMinecraft();
  SoundHandler soundHandler=mc.getSoundHandler();
  ChunkCoordinates coords=new ChunkCoordinates(x,y,z);
  Map mapSoundPositions=(Map)ReflectionPublicizer.get(ReflectionPublicizer.renderGlobalMapSoundPositions,mc.renderGlobal);
  ISound currentSound=(ISound)mapSoundPositions.get(coords);
  if (currentSound != null) {
    soundHandler.stopSound(currentSound);
    mapSoundPositions.remove(coords);
  }
  mc.ingameGUI.setRecordPlayingMessage("String_Node_Str" + recordData[0]);
  ResourceLocation resource=new ResourceLocation("String_Node_Str" + recordData[1]);
  PositionedSoundRecord snd=PositionedSoundRecord.func_147675_a(resource,x,y,z);
  mapSoundPositions.put(coords,snd);
  mc.getSoundHandler().playSound(snd);
}

Fixed version (ground truth):
@Override @SideOnly(Side.CLIENT) protected void handle(EntityClientPlayerMP player){
  String[] recordData=ItemMusicDisk.getRecordData(diskDamage);
  Minecraft mc=Minecraft.getMinecraft();
  SoundHandler soundHandler=mc.getSoundHandler();
  ChunkCoordinates coords=new ChunkCoordinates(x,y,z);
  Map mapSoundPositions=(Map)ReflectionPublicizer.get(ReflectionPublicizer.renderGlobalMapSoundPositions,mc.renderGlobal);
  ISound currentSound=(ISound)mapSoundPositions.get(coords);
  if (currentSound != null) {
    soundHandler.stopSound(currentSound);
    mapSoundPositions.remove(coords);
  }
  mc.ingameGUI.setRecordPlayingMessage("String_Node_Str" + recordData[0]);
  ResourceLocation resource=new ResourceLocation("String_Node_Str" + recordData[1]);
  PositionedSoundRecord snd=PositionedSoundRecord.func_147675_a(resource,x,y,z);
  mapSoundPositions.put(coords,snd);
  CustomMusicTicker.stopMusicAndPlayJukebox(snd);
}
Program: 34792
Project: 34792
Buggy source:
public CustomMusicTicker(Minecraft mc){
  super(mc);
  this.mc=mc;
  this.rand=new Random();
}

Fixed version (ground truth):
private CustomMusicTicker(Minecraft mc){
  super(mc);
  this.mc=mc;
  this.rand=new Random();
}
Program: 34793
Project: 34793
Buggy source:
@Override public void update(){
  MusicType type=getCurrentMusicType();
  if (currentMusic != null) {
    if (!type.getMusicTickerLocation().equals(currentMusic.getPositionedSoundLocation())) {
      mc.getSoundHandler().stopSound(currentMusic);
      timeUntilNextMusic=MathHelper.getRandomIntegerInRange(rand,0,type.func_148634_b() / 2);
    }
    if (!mc.getSoundHandler().isSoundPlaying(currentMusic)) {
      currentMusic=null;
      timeUntilNextMusic=Math.min(MathHelper.getRandomIntegerInRange(rand,type.func_148634_b(),type.func_148633_c()),timeUntilNextMusic);
    }
  }
  if (currentMusic == null && timeUntilNextMusic-- <= 0) {
    currentMusic=PositionedSoundRecord.func_147673_a(type.getMusicTickerLocation());
    mc.getSoundHandler().playSound(currentMusic);
    timeUntilNextMusic=Integer.MAX_VALUE;
  }
}

Fixed version (ground truth):
@Override public void update(){
  MusicType type=getCurrentMusicType();
  if (currentMusic != null) {
    if (!type.getMusicTickerLocation().equals(currentMusic.getPositionedSoundLocation()) && !isJukebox) {
      mc.getSoundHandler().stopSound(currentMusic);
      timeUntilNextMusic=MathHelper.getRandomIntegerInRange(rand,0,type.func_148634_b() / 2);
    }
    if (!mc.getSoundHandler().isSoundPlaying(currentMusic)) {
      currentMusic=null;
      timeUntilNextMusic=Math.min(MathHelper.getRandomIntegerInRange(rand,type.func_148634_b(),type.func_148633_c()),timeUntilNextMusic);
    }
  }
  if (currentMusic == null && timeUntilNextMusic-- <= 0) {
    currentMusic=PositionedSoundRecord.func_147673_a(type.getMusicTickerLocation());
    mc.getSoundHandler().playSound(currentMusic);
    timeUntilNextMusic=Integer.MAX_VALUE;
    isJukebox=false;
  }
}
Program: 34794
Project: 34794
Buggy source:
@SubscribeEvent public void onSoundLoad(SoundLoadEvent e){
  if (hasLoaded)   return;
  new Thread(new Runnable(){
    @Override public void run(){
      try {
        Thread.sleep(4000L);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
      Minecraft mc=Minecraft.getMinecraft();
synchronized (mc) {
        Field[] fields=Minecraft.class.getDeclaredFields();
        for (int a=0; a < fields.length; a++) {
          if (MusicTicker.class.isAssignableFrom(fields[a].getType())) {
            fields[a].setAccessible(true);
            try {
              fields[a].set(mc,new CustomMusicTicker(mc));
              DragonUtil.info("String_Node_Str");
            }
 catch (            Exception ex) {
              ex.printStackTrace();
              DragonUtil.severe("String_Node_Str");
              return;
            }
            break;
          }
        }
      }
    }
  }
).start();
  hasLoaded=true;
}

Fixed version (ground truth):
@SubscribeEvent public void onSoundLoad(SoundLoadEvent e){
  if (hasLoaded)   return;
  new Thread(new Runnable(){
    @Override public void run(){
      try {
        Thread.sleep(4000L);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
      Minecraft mc=Minecraft.getMinecraft();
synchronized (mc) {
        Field[] fields=Minecraft.class.getDeclaredFields();
        for (int a=0; a < fields.length; a++) {
          if (MusicTicker.class.isAssignableFrom(fields[a].getType())) {
            fields[a].setAccessible(true);
            try {
              fields[a].set(mc,CustomMusicTicker.getInstance());
              DragonUtil.info("String_Node_Str");
            }
 catch (            Exception ex) {
              ex.printStackTrace();
              DragonUtil.severe("String_Node_Str");
              return;
            }
            break;
          }
        }
      }
    }
  }
).start();
  hasLoaded=true;
}