[Demonstration 1]

[Buggy Method]
@Override
public BigDecimal getYearPersonalVolume(String userCode, String year) {
    Connection conn = null;
    PreparedStatement stmt = null;
    ResultSet rs = null;
    BigDecimal monthPersonalVolume = new BigDecimal(0);
    String sql = "SELECT sum(total) as total FROM orders o where user_id = ? " + " AND o.type=" + OrderType.ORDER_PRODUCT.getCode() + " and  DATE_FORMAT(cdate,'%Y') = ?";
    try {
        conn = getConnection();
        stmt = conn.prepareStatement(sql);
        stmt.setString(1, userCode);
        stmt.setString(2, year);
        rs = stmt.executeQuery();
        while (rs.next()) {
            monthPersonalVolume = rs.getBigDecimal(1);
        }
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        closeConnection(conn, stmt, rs);
    }
    return monthPersonalVolume;
}

[Buggy Hunk]
String sql = "SELECT sum(total) as total FROM orders o where user_id = ? " + " AND o.type=" + OrderType.ORDER_PRODUCT.getCode() + " and  DATE_FORMAT(cdate,'%Y') = ?";

[Patch]
String sql = "SELECT sum(total) as total FROM orders o where user_id = ? " + " AND (o.type=" + OrderType.ORDER_PRODUCT.getCode() + " OR o.type=" + OrderType.ORDER_PROACTIVE.getCode()+ ")"  + " and  DATE_FORMAT(cdate,'%Y') = ?";

[Demonstration 2]

[Buggy Method]
@Override
public void onRemoval(RemovalNotification<String, IncomingMessageData> notification) {
    IncomingMessageData data = notification.getValue();
    if (data != null) {
        removeFromCacheLookup(notification.getValue().user_name, notification.getKey());
    }
}

[Buggy Hunk]
removeFromCacheLookup(notification.getValue().user_name, notification.getKey());

[Patch]
removeFromCacheLookup(notification.getValue().user_name.toLowerCase(), notification.getKey());

[Demonstration 3]

[Buggy Method]
@EventHandler
public void openInv(InventoryOpenEvent e) {
    Player p = (Player) e.getPlayer();
    if (p.hasPermission("backpacks.furnaceBackPack")) {
        UUID id = p.getUniqueId();
        if (e.getInventory().equals(main.furnaceB.get(id))) {
            String trimmedID = id.toString().replace("-", "");
            Inventory inv = e.getInventory();
            try {
                rs = main.getResult("select * from furnaceBP_" + trimmedID);
                assert rs != null;
                if (rs.next()) {
                    load(rs.getInt(1), rs.getInt(2), inv);
                    int fuel = rs.getInt(3) / 64;
                    if (fuel <= 9) {
                        for (int i = 0; i < fuel; i++) {
                            int per = i + 1;
                            ItemStack g = new ItemStack(Material.STAINED_GLASS_PANE, 1, (byte) 5);
                            ItemMeta gMeta = g.getItemMeta();
                            gMeta.setDisplayName(ChatColor.GREEN + "" + per + per + "%");
                            g.setItemMeta(gMeta);
                            inv.setItem(26 + 1 + i, g);
                        }
                    } else {
                        fuel = 9;
                        for (int i = 0; i < fuel; i++) {
                            int per = i + 1;
                            ItemStack g = new ItemStack(Material.STAINED_GLASS_PANE, 1, (byte) 5);
                            ItemMeta gMeta = g.getItemMeta();
                            gMeta.setDisplayName(ChatColor.GREEN + "" + per + per + "%");
                            g.setItemMeta(gMeta);
                            inv.setItem(26 + 1 + i, g);
                        }
                    }
                }
            } catch (SQLException e1) {
                e1.printStackTrace();
            }
        }
    }
}

[Buggy Hunk]
load(rs.getInt(1), rs.getInt(2), inv);

[Patch]
load(rs.getInt(2), rs.getInt(1), inv);