[Demonstration 1]

[Buggy Method]
@Override
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) {
    if (!worldIn.isRemote) {
        float offsetHeight = 20f;
        EntityRPGRocket entityRPGRocket = new EntityRPGRocket(worldIn);
        Vec3 vec3 = playerIn.getPositionEyes(1);
        Vec3 vec31 = playerIn.getLook(1);
        Vec3 vec32 = vec3.addVector(vec31.xCoord * 50, vec31.yCoord * 50, vec31.zCoord * 50);
        worldIn.rayTraceBlocks(vec3, vec32, false, false, true);
        MovingObjectPosition movingObjectPosition = worldIn.rayTraceBlocks(vec3, vec32, false, false, true);
        BlockPos bp;
        if (movingObjectPosition.entityHit != null) {
            bp = new BlockPos(movingObjectPosition.entityHit);
        } else {
            bp = movingObjectPosition.getBlockPos();
        }
        entityRPGRocket.setLocationAndAngles(bp.getX() + .5d, bp.getY() + offsetHeight, bp.getZ() + .5d, 0, -90);
        boolean rtn = worldIn.spawnEntityInWorld(entityRPGRocket);
        entityRPGRocket = new EntityRPGRocket(worldIn);
        entityRPGRocket.setLocationAndAngles(bp.getX() + .5d + 2, bp.getY() + offsetHeight, bp.getZ() + .5d, 0, -90);
        rtn = rtn && worldIn.spawnEntityInWorld(entityRPGRocket);
        entityRPGRocket = new EntityRPGRocket(worldIn);
        entityRPGRocket.setLocationAndAngles(bp.getX() + .5d - 2, bp.getY() + offsetHeight, bp.getZ() + .5d, 0, -90);
        rtn = rtn && worldIn.spawnEntityInWorld(entityRPGRocket);
        entityRPGRocket = new EntityRPGRocket(worldIn);
        entityRPGRocket.setLocationAndAngles(bp.getX() + .5d, bp.getY() + offsetHeight, bp.getZ() + .5d + 2, 0, -90);
        rtn = rtn && worldIn.spawnEntityInWorld(entityRPGRocket);
        entityRPGRocket = new EntityRPGRocket(worldIn);
        entityRPGRocket.setLocationAndAngles(bp.getX() + .5d, bp.getY() + offsetHeight, bp.getZ() + .5d - 2, 0, -90);
        rtn = rtn && worldIn.spawnEntityInWorld(entityRPGRocket);
        if (rtn && !playerIn.capabilities.isCreativeMode) {
            // spawned in world so reduce stack size
            // only if they are not in creative .. because FUN !
            itemStackIn.stackSize--;
        }
        Log.info(rtn);
    }
    return itemStackIn;
}

[Buggy Hunk]
Vec3 vec3 = playerIn.getPositionEyes(1);

[Patch]
Vec3 vec3 = new Vec3(playerIn.posX, playerIn.posY + (double) playerIn.getEyeHeight(), playerIn.posZ);

[Demonstration 2]

[Buggy Method]
public void keyPressed(KeyEvent e) {
    if (menu) {
        menu = false;
        explosionTimer = System.currentTimeMillis();
        return;
    }
    player.pressed(e.getKeyCode());
}

[Buggy Hunk]
public void keyPressed(KeyEvent e) {

[Patch]
public void keyPressed(final KeyEvent e) {

[Demonstration 3]

[Buggy Method]
public static void main(String[] args) {
    RandomizedQueue<String> queue = new RandomizedQueue<String>();
    int k = StdIn.readInt();
    while (StdIn.hasNextLine()) {
        queue.enqueue(StdIn.readString());
    }
    Iterator<String> iterator = queue.iterator();
    while (k > 0 && iterator.hasNext()) {
        StdOut.println(iterator.next());
        k--;
    }
}

[Buggy Hunk]
while (StdIn.hasNextLine()) {

[Patch]
while (!StdIn.isEmpty()) {