[Demonstration 1]

[Buggy Method]
@RequestMapping("/generate")
public RomanResult generate(@RequestParam("number") String numberStr) {
    int number = 0;
    try {
        number = Integer.parseInt(numberStr);
    } catch (NumberFormatException e) {
        return new RomanResult(null, RomanNumeralGeneratorImpl.NOT_SUPPORTED);
    }
    String generateRoman = romanNumeralGenerator.generate(number);
    if (RomanNumeralGeneratorImpl.NOT_SUPPORTED.equals(generateRoman)) {
        return new RomanResult(null, RomanNumeralGeneratorImpl.NOT_SUPPORTED);
    } else {
        return new RomanResult(generateRoman, OK);
    }
}

[Buggy Hunk]
public RomanResult generate(@RequestParam("number") String numberStr) {

[Patch]
public Result generate(@RequestParam("number") String numberStr) {

[Demonstration 2]

[Buggy Method]
@Override
public void run() {
    RunAsClassLoader.run(classLoader, () -> {
        try {
            // { Validating }
            runHooks(ProcessStep.Validating);
            for (Method m : onValidate) {
                if (m.getReturnType() == List.class) {
                    addError((List<String>) m.invoke(handler));
                } else if (m.getReturnType() == boolean.class) {
                    if (!(boolean) m.invoke(handler))
                        addError("Validator " + m.getName() + " returned false");
                } else {
                    throw new RuntimeException("onValidate method " + m.getName() + " has wrong return type " + m.getReturnType());
                }
            }
            // Run the message if there are no errors.
            if (errors.size() > 0) {
                // { Invalid }
                getErrors().stream().forEach(e -> log.error(e));
                runHooks(ProcessStep.Invalid);
                // !!EXIT!! if invalid, do not continue
                return;
            } else {
                // { Processing }
                runHooks(ProcessStep.Processing);
                for (Method m : onMessage) {
                    m.invoke(handler, new Object[] {});
                }
            }
        } catch (Throwable e) {
            // If we got any errors, log them
            log.info("Error processing", e);
            if (e.getCause() != null)
                addError(e.getCause().getMessage());
            else
                addError(e.getMessage());
        }
        // We've done all we can do to process this message, ack it from the queue, and move forward.
        if (errors.size() > 0) {
            // { Error }
            getErrors().stream().forEach(e -> log.error(e));
            try {
                for (Method m : onProcessStep.get(ProcessStep.Error)) {
                    m.invoke(handler);
                }
            } catch (Throwable e) {
                log.error("Error in @On(ProcessStep.Error) handler.", e);
            }
            LifeCycleMonitors.call(ProcessStep.Error, this);
        } else {
            // { Complete }
            try {
                runHooks(ProcessStep.Complete);
            } catch (Throwable e) {
                log.error("Error in @On(ProcessStep.Complete) handler.", e);
                LifeCycleMonitors.call(ProcessStep.Error, this);
            }
        }
        try {
            msg.getJmsMsg().acknowledge();
        } catch (JMSException e) {
            log.error("Error while acking message.", e);
        }
    });
}

[Buggy Hunk]
m.invoke(handler, new Object[] {});

[Patch]
m.invoke(handler);

[Demonstration 3]

[Buggy Method]
@Override
public void visit(ExistsExpression ee) {
    throw new UnsupportedOperationException("ExistsExpression in SQL Not supported yet.");
}

[Buggy Hunk]
throw new UnsupportedOperationException("ExistsExpression in SQL Not supported yet.");

[Patch]
ee.getRightExpression().accept(this);