[Demonstration 1]

[Buggy Method]
public int getPlayersInHand(ArrayList<Player> players) {
    int count = 0;
    for (Player player : players) {
        if (player.stack > 0) {
            count++;
        }
    }
    return count;
}

[Buggy Hunk]
if (player.stack > 0) {

[Patch]
if (player.inHand) {

[Demonstration 2]

[Buggy Method]
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int p_77663_4_, boolean p_77663_5_) {
    super.onUpdate(stack, world, entity, p_77663_4_, p_77663_5_);
    if (entity instanceof EntityPlayer) {
        if (!world.isRemote) {
            EntityPlayer player = (EntityPlayer) entity;
            player.addPotionEffect(new PotionEffect(Potion.poison.id, 1, 1));
        }
    }
}

[Buggy Hunk]
player.addPotionEffect(new PotionEffect(Potion.poison.id, 1, 1));

[Patch]
player.addPotionEffect(new PotionEffect(Potion.wither.id, 100, 2));

[Demonstration 3]

[Buggy Method]
public void addExperience(int experience) {
    //Display text for experience earned.
    universe.text_handler.createDecayText("+" + experience + "xp", universe.screen.gui.bar_experience.x, universe.screen.gui.bar_experience.y + universe.screen.gui.bar_experience.MAX_BAR_HEIGHT, Color.YELLOW);
    //Increase experience (and experience bar indirectly) by this amount.
    this.experience_current += experience;
    while (this.experience_current >= EXPERIENCE_MAX) ;
    {
        levelUp();
        this.experience_current -= EXPERIENCE_MAX;
    }
}

[Buggy Hunk]
while(this.experience_current >= EXPERIENCE_MAX);

[Patch]
while(this.experience_current >= EXPERIENCE_MAX)