[Demonstration 1]

[Buggy Method]
@SuppressWarnings("unchecked")
@Override
public // Get the scores weighted by the exploration factor
DataCell getCell(final DataRow row) {
    RowKey key = row.getKey();
    Pair<String, String> names = m_outFiles.get(key);
    DataCell cell;
    try {
        String outfile = names.getFirst();
        String source = names.getSecond();
        final ImgPlus<T> img = (ImgPlus<T>) imgOpener.getImg(outfile, 0);
        img.setSource(source);
        img.setName(key + "_result");
        cell = m_imgPlusCellFactory.createCell(img);
    } catch (Exception e) {
        cell = new MissingCell("Error during execution: " + e);
    }
    return cell;
}

[Buggy Hunk]
cell = new MissingCell("Error during execution: " + e);

[Patch]
throw new IllegalStateException("Error during execution: " + e, e);

[Demonstration 2]

[Buggy Method]
private LoginModuleControlFlag loginModuleControlFlag(String flag) {
    LoginModuleControlFlag controlFlag;
    switch(flag.toUpperCase(Locale.ROOT)) {
        case "REQUIRED":
            controlFlag = LoginModuleControlFlag.REQUIRED;
            break;
        case "REQUISITE":
            controlFlag = LoginModuleControlFlag.REQUISITE;
            break;
        case "SUFFICIENT":
            controlFlag = LoginModuleControlFlag.SUFFICIENT;
            break;
        case "OPTIONAL":
            controlFlag = LoginModuleControlFlag.OPTIONAL;
            break;
        default:
            throw new IllegalArgumentException("Invalid login module control flag " + flag);
    }
    return controlFlag;
}

[Buggy Hunk]
throw new IllegalArgumentException("Invalid login module control flag " + flag);

[Patch]
throw new IllegalArgumentException("Invalid login module control flag '" + flag + "' in JAAS config");

[Demonstration 3]

[Buggy Method]
private Map<String, String> buildHeaders() {
    MarcoExecutor executor = null;
    Map<String, String> mailHeaders = new HashMap<String, String>();
    try {
        executor = new MarcoExecutor();
        MarcoBuilder.build(executor, Paths.get(getClass().getResource("/marco").toURI()));
        Enumeration e = mMailHeaderConfig.getHeaderProperties().propertyNames();
        while (e.hasMoreElements()) {
            String headerKey = (String) e.nextElement();
            mailHeaders.put(headerKey, executor.executeMarco(mMailHeaderConfig.getHeaderProperties().getProperty(headerKey)));
            mLogger.debug("{}:{}=>{}", new String[] { headerKey, mMailHeaderConfig.getHeaderProperties().getProperty(headerKey), executor.executeMarco(mMailHeaderConfig.getHeaderProperties().getProperty(headerKey)) });
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    //        String sendDate = new Date().toString();
    //        mailHeaders.put(this.MAIL_HEADER_RECEIVED, "from " + this.getFromIP() + " by " + this.getProxyIP() + "; " + sendDate);
    //        mailHeaders.put(this.MAIL_HEADER_SEND_DATE, sendDate);
    //        mailHeaders.put(this.MAIL_HEADER_MESSAGE_ID, this.genMessageId());
    //        mailHeaders.put(this.MAIL_HEADER_X_MAILER, "sendMail");
    //        mailHeaders.put(this.MAIL_HEADER_X_PRIORITY, "3");
    //        mailHeaders.put(this.MAIL_HEADER_X_MSMAIL_PRIORITY, "3");
    return mailHeaders;
}

[Buggy Hunk]
MarcoBuilder.build(executor, Paths.get(getClass().getResource("/marco").toURI()));

[Patch]
MarcoBuilder.build(executor, mMarcoPath);