[Demonstration 1]

[Buggy Method]
public void executeTriggerCode(String code, int businessRuleID) throws Exception {
    try {
        Trigger trigger = new Trigger(code, DefineDomainService.getInstance().getBusinessRuleFromList(businessRuleID).getTargetDatabase());
        GeneratePersistencyService.getInstance().executeTrigger(trigger.getCode(), trigger.getTargetDatabase().getTargetDatabaseDetails());
    } catch (NullPointerException e) {
        e.printStackTrace();
        throw new Exception("Cannot execute trigger");
    }
}

[Buggy Hunk]
throw new Exception("Cannot execute trigger");

[Patch]
throw new Exception("Cannot execute trigger" + DatabaseErrorLogger.getInstance().getErrors());

[Demonstration 2]

[Buggy Method]
public ReturnObject add(int index, Object item) {
    if (checkIndex(index).hasError()) {
        return checkIndex(index);
    }
    if (checkItem(item).hasError()) {
        return checkItem(item);
    }
    if (top == items.length + 1) {
        growArray();
    }
    for (int i = top; i > index; i--) {
        items[i] = items[i - 1];
    }
    items[index] = item;
    top++;
    return new ReturnObjectImpl(ErrorMessage.NO_ERROR);
}

[Buggy Hunk]
if(top == items.length + 1) {

[Patch]
if(top + 1 == items.length) {

[Demonstration 3]

[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("-.+", ""));