[Demonstration 1]

[Buggy Method]
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = { "REC_CATCH_EXCEPTION" }, justification = "Using catch all to detect invalid dates.")
@SuppressWarnings({ "PMD.CyclomaticComplexity", "PMD.NPathComplexity" })
@Override
public void validate(Object target, Errors errors) {
    if (target instanceof PenaltyParametersDto) {
        return;
    }
    PenaltyFormBean formBean = (PenaltyFormBean) target;
    checkCategory(errors, formBean.getCategoryTypeId());
    checkStatus(errors, formBean.getStatusId());
    if (StringUtils.hasText(formBean.getPeriodTypeId()) && !formBean.getPeriodTypeId().equalsIgnoreCase("3")) {
        checkNumber(errors, formBean.getDuration(), "Grace Period Duration", digits);
    } else {
        incorrectIntegerValue(errors, formBean.getDuration(), "Grace Period Duration", digits);
    }
    emptyField(errors, formBean.getName(), "Penalty Name");
    emptyField(errors, formBean.getFrequencyId(), "Penalty Application Frequency");
    emptyField(errors, formBean.getGlCodeId(), "GL Code");
    checkNumber(errors, formBean.getMin(), "Cumulative Penalty Limit (Minimum)", digits, decimal);
    checkNumber(errors, formBean.getMax(), "Cumulative Penalty Limit (Maximum)", digits, decimal);
    checkMinGreaterMax(errors, formBean.getMin(), formBean.getMax());
    if (StringUtils.hasText(formBean.getCategoryTypeId()) && formBean.getCategoryTypeId().equalsIgnoreCase("1")) {
        if (StringUtils.hasText(formBean.getRate()) && StringUtils.hasText(formBean.getAmount())) {
            errors.reject("error.penalty.amountAndRateOrFormula");
        } else if (StringUtils.hasText(formBean.getRate()) && StringUtils.hasText(formBean.getFormulaId())) {
            checkNumber(errors, formBean.getRate(), "Rate", digits, decimal);
        } else if (StringUtils.hasText(formBean.getRate()) && !StringUtils.hasText(formBean.getFormulaId())) {
            errors.reject("error.penalty.rate");
        } else if (StringUtils.hasText(formBean.getAmount())) {
            checkNumber(errors, formBean.getAmount(), "Amount", digits, decimal);
        } else {
            errors.reject("error.penalty.amountAndRateOrFormula");
        }
    } else {
        checkNumber(errors, formBean.getAmount(), "Amount", digits, decimal);
    }
}

[Buggy Hunk]
incorrectIntegerValue(errors, formBean.getDuration(), "Grace Period Duration", digits);

[Patch]
formBean.setDuration("");

[Demonstration 2]

[Buggy Method]
@Override
public void onDisable() {
    plugin = null;
    Container.getContainer().saveData();
}

[Buggy Hunk]
Container.getContainer().saveData();

[Patch]
Container.getContainer().getSaver().saveAll(Container.getContainer().getCommandBlocks().values());

[Demonstration 3]

[Buggy Method]
private static String[] getJarPaths(String jarPath) throws IOException {
    return Files.walk(Paths.get(jarPath)).map(Path::toString).filter(path -> path.endsWith(".jar")).map(path -> new File(path).getAbsolutePath()).toArray(String[]::new);
}

[Buggy Hunk]
private static String[] getJarPaths(String jarPath) throws IOException {

[Patch]
private String[] getJarPaths(String jarPath) throws IOException {