[Demonstration 1]

[Buggy Method]
@Override
public Dish deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
    JsonNode node = null;
    try {
        node = p.getCodec().readTree(p);
    } catch (IOException e) {
        logger.info("Error while obtaining the node tree: " + e.getMessage());
    }
    Dish dish = null;
    try {
        Long dishId = (Long) ((IntNode) node.get("dishId")).numberValue();
        dish = dishService.getById(dishId);
        ArrayNode ingredients = ((ArrayNode) node.get("ingredients"));
        Map<Ingredient, Double> ingredientsInMap = convertJSONToMap(ingredients);
        dish.setIngredients(ingredientsInMap);
    } catch (Exception e) {
        logger.error("Error: " + e.getMessage());
    }
    return dish;
}

[Buggy Hunk]
Long dishId = (Long) ((IntNode) node.get("dishId")).numberValue();

[Patch]
Long dishId = Long.parseLong(node.get("dishId").asText());

[Demonstration 2]

[Buggy Method]
@Override
public void load(ConfigurationSection config) {
    ConfigurationSection triggers = config.getConfigurationSection("components");
    if (triggers != null) {
        for (String key : triggers.getKeys(false)) {
            try {
                Trigger trigger = Trigger.valueOf(key.toUpperCase().replace(' ', '_'));
                EffectComponent component = trigger.getComponent();
                component.load(this, triggers.getConfigurationSection(key));
                components.put(trigger, component);
            } catch (Exception ex) {
                // Invalid trigger
                Bukkit.getLogger().warning("Invalid trigger for the skill \"" + getName() + "\" - \"" + key + "\"");
            }
        }
    }
    super.load(config);
}

[Buggy Hunk]
Trigger trigger = Trigger.valueOf(key.toUpperCase().replace(' ', '_'));

[Patch]
Trigger trigger = Trigger.valueOf(key.toUpperCase().replace(' ', '_').replaceAll("-.+", ""));

[Demonstration 3]

[Buggy Method]
private void launchEventMessage(int slotId, TextMessage msg) {
    if (msg == null || (msg.text != null && msg.text.length() == 0)) {
        CatLog.d(LOG_TAG, "launchEventMessage return");
        return;
    }
    Toast toast = new Toast(mContext.getApplicationContext());
    LayoutInflater inflate = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View v = inflate.inflate(R.layout.stk_event_msg, null);
    TextView tv = (TextView) v.findViewById(com.android.internal.R.id.message);
    ImageView iv = (ImageView) v.findViewById(com.android.internal.R.id.icon);
    if (msg.icon != null) {
        iv.setContentDescription(TEXT_ICON_FROM_COMMAND);
        iv.setImageBitmap(msg.icon);
    } else {
        iv.setVisibility(View.GONE);
    }
    /* In case of 'self explanatory' stkapp should display the specified
         * icon in proactive command (but not the alpha string).
         * If icon is non-self explanatory and if the icon could not be displayed
         * then alpha string or text data should be displayed
         * Ref: ETSI 102.223,section 6.5.4
         */
    if (mStkContext[slotId].mCurrentCmd.hasIconLoadFailed() || msg.icon == null || !msg.iconSelfExplanatory) {
        tv.setText(msg.text);
    }
    toast.setView(v);
    toast.setDuration(Toast.LENGTH_LONG);
    toast.setGravity(Gravity.BOTTOM, 0, 0);
    toast.show();
}

[Buggy Hunk]
if (msg == null || (msg.text != null && msg.text.length() == 0)) {

[Patch]
if (msg == null || msg.text == null || msg.text.length() == 0) {