[Demonstration 1]

[Buggy Method]
@Test
public void testBlockTryCatchWithResourceCheck() {
    try {
        generate(TryCatch6_tryWithResources.class);
        Assert.fail("Should not get here: an exception was expected");
    } catch (GeneratorException e) {
        Assert.assertTrue(e.getMessage().contains("try-with-resources is not supported"));
    }
}

[Buggy Hunk]
} catch (GeneratorException e) {

[Patch]
} catch (STJSRuntimeException e) {

[Demonstration 2]

[Buggy Method]
@Authorized(value = "admin")
@Transactional
public Result removeManager(long contestId, long contestManagerId) throws ContestNotFoundException, ContestManagerNotFoundException {
    Contest contest = contestService.findContestById(contestId);
    ContestManager contestManager = contestManagerService.findContestManagerById(contestManagerId);
    if (contest.isLocked() || !contestManager.getContestJid().equals(contest.getJid())) {
        return ContestControllerUtils.getInstance().tryEnteringContest(contest, IdentityUtils.getUserJid());
    }
    contestManagerService.deleteContestManager(contestManager.getId());
    UrielControllerUtils.getInstance().addActivityLog("Delete manager " + JidCacheServiceImpl.getInstance().getDisplayName(contestManager.getUserJid()) + ".");
    return redirect(routes.UserController.index());
}

[Buggy Hunk]
return redirect(routes.UserController.index());

[Patch]
return redirect(routes.ContestManagerController.viewManagers(contest.getId()));

[Demonstration 3]

[Buggy Method]
public void handleExpectedError(IncomingMessageEnvelope envelope, Exception e) throws Exception {
    if (logger.isInfoEnabled()) {
        logger.error("Error processing message", e);
    }
    StreamMsgHandler handler = getStreamMsgHandler(envelope);
    errorHandler.handleExpectedError(envelope, e);
    handler.metrics.dropped.mark();
}

[Buggy Hunk]
logger.error("Error processing message", e);

[Patch]
logger.info("Error processing message", e);