[Demonstration 1]

[Buggy Method]
public void setupSigns() {
    i = new ItemStack(Material.SIGN, this.getConfig().getInt("signamount"));
    im = i.getItemMeta();
    lores.clear();
    lores.add(Message.replaceColors(lang.getLang("signlore")));
    im.setDisplayName(Message.replaceColors(lang.getLang("signname")));
    im.setLore(lores);
    i.setItemMeta(im);
    if (getConfig().getBoolean("signcrafting")) {
        removeRecipe();
        if (getConfig().get("recipetype").equals("shapeless")) {
            List<String> ingredients = (List<String>) getConfig().getList("recipes.shapeless.ingredients");
            if (ingredients.size() > 9) {
                log.warning("You added more than nine crafting items to the config!");
                log.warning("Please change it or you will not be able to craft colored signs!");
                return;
            }
            ShapelessRecipe sr = new ShapelessRecipe(i);
            for (String ingredient : ingredients) {
                if (ingredient.contains(":")) {
                    String[] ingredientData = ingredient.split(":");
                    Material m = Material.getMaterial(ingredientData[0]);
                    sr.addIngredient(m, Integer.valueOf(ingredientData[1]));
                } else {
                    Material m = Material.getMaterial(ingredient);
                    sr.addIngredient(m);
                }
            }
            getServer().addRecipe(sr);
            signcrafting = true;
        } else if (getConfig().get("recipetype").equals("shaped")) {
            removeRecipe();
            List<String> shape = (List<String>) getConfig().getList("recipes.shaped.craftingshape");
            if (shape.size() > 3) {
                log.warning("You added more than three recipe shapes to the config!");
                log.warning("Please change it or you will not be able to craft colored signs!");
                return;
            }
            ShapedRecipe sr = new ShapedRecipe(i);
            switch(shape.size()) {
                case 1:
                    sr.shape(shape.get(0));
                    break;
                case 2:
                    sr.shape(shape.get(0), shape.get(1));
                    break;
                case 3:
                    sr.shape(shape.get(0), shape.get(1), shape.get(2));
                    break;
                default:
                    log.warning("You defined too many or no recipe shapes!");
                    log.warning("Please change it or you will not be able to craft colored signs!");
                    return;
            }
            ConfigurationSection ingredients = getConfig().getConfigurationSection("recipes.shaped.ingredients");
            for (String key : ingredients.getKeys(false)) {
                if (ingredients.get(key).toString().contains(":")) {
                    String[] ingredient = ingredients.get(key).toString().split(":");
                    Material m = Material.getMaterial(ingredient[0]);
                    sr.setIngredient(key.charAt(0), m, Integer.valueOf(ingredient[1]));
                } else {
                    Material m = Material.getMaterial(ingredients.get(key).toString());
                    sr.setIngredient(key.charAt(0), m);
                }
            }
            getServer().addRecipe(sr);
            signcrafting = true;
        } else {
            log.warning("Unknown config value of 'recipetype'! Possible values are: 'shaped' and 'shapeless'.");
            log.warning("Please change it or you will not be able to craft colored signs!");
        }
    } else {
        removeRecipe();
        signcrafting = false;
    }
}

[Buggy Hunk]
im = i.getItemMeta();

[Patch]
ItemMeta im = i.getItemMeta();

[Demonstration 2]

[Buggy Method]
@Override
protected void handleMessage(InvalidMessage im) {
    if (im.getNextDestination() != null) {
        return;
    }
    List<String> newInvalid = intersect(im.invalid, remainingProperties);
    if (newInvalid.isEmpty()) {
        return;
    }
    remainingProperties.removeAll(newInvalid);
    invalidProperties.addAll(newInvalid);
    inductiveCounterexamples.keySet().removeAll(newInvalid);
    double runtime = getRuntime();
    for (String invalidProp : newInvalid) {
        Model slicedModel = ModelSlicer.slice(im.model, analysisSpec.dependencyMap.get(invalidProp));
        Counterexample cex = extractCounterexample(invalidProp, im.length, slicedModel);
        writer.writeInvalid(invalidProp, im.source, cex, Collections.emptyList(), runtime);
    }
}

[Buggy Hunk]
Counterexample cex = extractCounterexample(invalidProp, im.length, slicedModel);

[Patch]
Counterexample cex = extractCounterexample(invalidProp, im.length, slicedModel, true);

[Demonstration 3]

[Buggy Method]
public ResultSet getUserById(int id) throws SQLException {
    DBHelper help = new DBHelper();
    return help.findById(tableName, id);
}

[Buggy Hunk]
DBHelper help = new DBHelper();

[Patch]
help = new DBHelper();