[Demonstration 1]

[Buggy Method]
private void initSaving(TableView<Drug> tblv) {
    xmlImporter.write(xmlImporter.read());
    LOGGER.log(Level.INFO, "Saving to file... | " + bookingOutTableView.getItems());
}

[Buggy Hunk]
xmlImporter.write(xmlImporter.read());

[Patch]
xmlImporter.write(bookingOutTableView.getItems());

[Demonstration 2]

[Buggy Method]
public static String readOutput(Process process, IProgressMonitor monitor) throws IOException {
    InputStream stream = new BufferedInputStream(process.getInputStream());
    StringBuilder text = new StringBuilder();
    while (true) {
        if (monitor.isCanceled()) {
            return text.toString();
        } else if (stream.available() > 0) {
            int c = stream.read();
            if (c == -1) {
                return text.toString();
            }
            text.append((char) c);
        } else if (isTerminated(process)) {
            return text.toString();
        } else {
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
            }
        }
    }
}

[Buggy Hunk]
} else if (isTerminated(process)) {

[Patch]
} else if (!process.isAlive()) {

[Demonstration 3]

[Buggy Method]
private int readBase() {
    String s;
    JSONObject rdJson = null;
    try {
        ctRd = new BufferedReader(new InputStreamReader(new FileInputStream(ctFile)));
        while ((s = ctRd.readLine()) != null) {
            try {
                rdJson = (JSONObject) (new JSONParser()).parse(s);
            } catch (ParseException e) {
                e.printStackTrace();
            }
            String key = rdJson.get("id").toString();
            if (!cities.containsKey(key)) {
                cities.put(key, s);
            }
        }
        ctRd.close();
    } catch (FileNotFoundException e) {
        System.out.println("Error: City base file not found");
        e.printStackTrace();
        System.exit(1);
    } catch (IOException e) {
        System.out.println("Error: Can't read City base file");
        e.printStackTrace();
        System.exit(1);
    }
    return 0;
}

[Buggy Hunk]
ctRd = new BufferedReader(new InputStreamReader(new FileInputStream(ctFile)));

[Patch]
ctRd = new BufferedReader(new InputStreamReader(new FileInputStream(ctFile),"UTF-8"));