[Demonstration 1]

[Buggy Method]
public void parseExcelFile() throws ParseException {
    try {
        FileInputStream excelFile = new FileInputStream(new File(FILE_NAME));
        Workbook workbook = new XSSFWorkbook(excelFile);
        Sheet backupNurseSheet = workbook.getSheetAt(BACKUP_NURSE_SHEET);
        Sheet feasibleVisits = workbook.getSheetAt(VISITS_COST_SHEET);
        parseBackupNurseSheet(backupNurseSheet);
        parseFeasibleVisitSheet(feasibleVisits);
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
}

[Buggy Hunk]
FileInputStream excelFile = new FileInputStream(new File(FILE_NAME));

[Patch]
FileInputStream excelFile = new FileInputStream(new File(this.filename));

[Demonstration 2]

[Buggy Method]
@Override
public void run() {
    try {
        KeyStore ks = KeyStore.getInstance("JKS");
        ks.load(new FileInputStream(keyStoreLocation), keyStorePassword.toCharArray());
        KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
        kmf.init(ks, "password".toCharArray());
        TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
        tmf.init(ks);
        SSLContext sc = SSLContext.getInstance("TLS");
        TrustManager[] trustManagers = tmf.getTrustManagers();
        sc.init(kmf.getKeyManagers(), trustManagers, null);
        SSLServerSocketFactory ssf = sc.getServerSocketFactory();
        SSLServerSocket serverSocket = (SSLServerSocket) ssf.createServerSocket(serverPort);
        Logger.info("Waiting for clients on port: {}", serverPort);
        while (run) {
            SSLSocket clientSocket = (SSLSocket) serverSocket.accept();
            if (!run)
                // Previous call is blocking, so check again to avoid IOExceptions or stalled threads.
                break;
            ClientThread client = new ClientThread(clientSocket, this);
            clients.add(client);
            client.start();
        }
        // end run loop
        try {
            serverSocket.close();
            for (ClientThread client : clients) client.end();
        } catch (IOException ioe) {
            Logger.error("Error closing the serverSocket: {}", ioe);
        }
    } catch (IOException ioe) {
        Logger.error("IOException while creating ServerSocket on port: {}\n{}", serverPort, ioe);
    } catch (KeyStoreException e) {
        Logger.error("Instance of keystore isn't correctly defined.", e);
    } catch (NoSuchAlgorithmException e) {
        Logger.error("Error loading keystore.", e);
    } catch (CertificateException e) {
        Logger.error("Error loading passed certificate keystore.", e);
    } catch (UnrecoverableKeyException e) {
        Logger.error("Passed password doesn't unlock the keystore.", e);
    } catch (KeyManagementException e) {
        Logger.error("Issue retrieving keymanager.", e);
    } catch (Exception e) {
        Logger.error(e);
    }
}

[Buggy Hunk]
kmf.init(ks, "password".toCharArray());

[Patch]
kmf.init(ks, keyStorePassword.toCharArray());

[Demonstration 3]

[Buggy Method]
private static Boolean validateFileContent(List<String> content) {
    for (int i = 0; i < content.size(); i++) {
        String s = content.get(i);
        // fist string has to be an string representation of the AVL option
        if (i == 0) {
            if (s != "false" && s != "true") {
                return false;
            }
            // rest of the strings are nodes to load
        } else {
            if (s.length() < 1 || s.length() > 3) {
                return false;
            }
        }
    }
    return true;
}

[Buggy Hunk]
if (s != "false" && s != "true") {

[Patch]
if (s.compareTo("false") != 0 && s.compareTo("true") != 0) {