[Demonstration 1]

[Buggy Method]
private boolean isLegal() {
    //set blank input to be 0
    if (usrInput.isEmpty())
        usrInput = "0";
    char[] toChar = usrInput.toCharArray();
    //check whether there is illegal characters
    for (int i = 0; i < toChar.length; i++) if (!ACCEPT.contains(toChar[i]))
        return false;
    //check the use of parenthesis
    if (this.hasParenthesis())
        if (!isParenthesisLegal(usrInput))
            return false;
    //check the first & last character
    char first = usrInput.charAt(0);
    char last = usrInput.charAt(usrInput.length() - 1);
    return (first == '(' || isNum(first)) && (last == ')' || last == '!' || isNum(last));
}

[Buggy Hunk]
return (first == '(' || isNum(first)) && (last == ')' || last == '!' || isNum(last));

[Patch]
return (first == '(' || isNum(first) || first == '-') && (last == ')' || last == '!' || isNum(last));

[Demonstration 2]

[Buggy Method]
@SubscribeEvent
public static void editSign(RightClickBlock event) {
    if (event.getEntityPlayer().isSneaking()) {
        return;
    }
    BlockPos pos = new BlockPos(event.getHitVec());
    IBlockState state = event.getWorld().getBlockState(pos);
    if (state.getBlock() != Blocks.WALL_SIGN && state.getBlock() != Blocks.STANDING_SIGN) {
        return;
    }
    EntityPlayer player = event.getEntityPlayer();
    TileEntity tileentity = event.getWorld().getTileEntity(pos);
    if (tileentity instanceof TileEntitySign) {
        TileEntitySign sign = (TileEntitySign) tileentity;
        sign.setPlayer(player);
        sign.setEditable(true);
        player.openEditSign(sign);
    }
}

[Buggy Hunk]
sign.setEditable(true);

[Patch]
ObfuscationReflectionHelper.setPrivateValue(TileEntitySign.class, sign, true, "field_145916_j", "isEditable");

[Demonstration 3]

[Buggy Method]
public static boolean isAlreadyRIchest(Block sign) {
    //Check below the sign
    Block block = sign.getWorld().getBlockAt(sign.getX(), sign.getY() - 1, sign.getZ());
    int x = block.getX(), y = block.getY(), z = block.getZ();
    Block posSign = block.getWorld().getBlockAt(x, y - 2, z);
    if ((block.getType() == Material.CHEST || block.getType() == Material.DISPENSER) && (posSign.getType() == Material.WALL_SIGN || posSign.getType() == Material.SIGN_POST)) {
        return (signUtils.isRIsign(((Sign) posSign.getState()).getLine(1)));
    }
    //Check above the sign
    block = sign.getWorld().getBlockAt(sign.getX(), sign.getY() + 1, sign.getZ());
    posSign = block.getWorld().getBlockAt(x, y + 2, z);
    if ((block.getType() == Material.CHEST || block.getType() == Material.DISPENSER) && (posSign.getType() == Material.WALL_SIGN || posSign.getType() == Material.SIGN_POST)) {
        return (signUtils.isRIsign(((Sign) posSign.getState()).getLine(1)));
    }
    return false;
}

[Buggy Hunk]
int x = block.getX(), y = block.getY(), z = block.getZ();

[Patch]
int x = sign.getX(), y = sign.getY(), z = sign.getZ();