[Demonstration 1]

[Buggy Method]
public String toString() {
    return space + isFree + isVirtual;
}

[Buggy Hunk]
return space + isFree + isVirtual;

[Patch]
return space.substring(0, 1) + isFree + isVirtual + deviceID.substring(17, 20);

[Demonstration 2]

[Buggy Method]
public static List<String[]> blastResults(AbstractSequence sequence, File workDir, File blastdb, Logger logger) throws IOException, InterruptedException, ApplicationException {
    Process blast = null;
    String blastPath = Settings.getInstance().getBlastPathStr();
    List<String[]> ans = new ArrayList<String[]>();
    if (sequence.getLength() != 0) {
        File query = new File(workDir, "query.fasta");
        FileOutputStream queryFile = new FileOutputStream(query);
        sequence.writeFastaOutput(queryFile);
        queryFile.close();
        String cmd = blastPath + "blastall -p blastn -q -1 -r 1 " + " -i " + query.getAbsolutePath() + " -m 8 -d " + blastdb.getAbsolutePath();
        logger.info(cmd);
        blast = Runtime.getRuntime().exec(cmd, null, workDir);
        BufferedReader inReader = new BufferedReader(new InputStreamReader(blast.getInputStream()));
        String inLine = inReader.readLine();
        while ((inLine = inReader.readLine()) != null) {
            // clear in buff so java dont dead lock
            String[] values = inLine.split("\t");
            ans.add(values);
        }
        final BufferedReader errReader = new BufferedReader(new InputStreamReader(blast.getErrorStream()));
        String errLine;
        while ((errLine = errReader.readLine()) != null) System.out.println(errLine);
        int exitResult = blast.waitFor();
        blast.getErrorStream().close();
        blast.getInputStream().close();
        blast.getOutputStream().close();
        if (exitResult != 0)
            throw new ApplicationException("blast exited with error: " + exitResult);
    }
    return ans;
}

[Buggy Hunk]
String inLine = inReader.readLine();

[Patch]
String inLine = null;

[Demonstration 3]

[Buggy Method]
@Override
public void handle(InputStream stream) throws IOException {
    BufferedReader reader = new BufferedReader(new InputStreamReader(stream, charset));
    boolean listingFound = false;
    boolean salesFound = false;
    boolean buyOrdersFound = false;
    boolean immediateSaleFound = false;
    StringBuilder stringBuilder = new StringBuilder();
    String line;
    while ((line = reader.readLine()) != null) {
        if (logger.isDebugEnabled()) {
            stringBuilder.append(line).append('\n');
        }
        if (!buyOrdersFound) {
            if (line.indexOf("market_commodity_order_block") > -1) {
                buyOrders = true;
                buyOrdersFound = true;
            }
        }
        if (line.indexOf("There are no listings for this item") > -1) {
            noListingForThisItem = true;
            return;
        }
        if (line.indexOf("There is no price history available") > -1) {
            noPricingHistoryForThisItem = true;
            return;
        }
        if (line.indexOf("This item may no longer be bought or sold on the market") > -1) {
            noLongerSold = true;
            return;
        }
        if (!immediateSaleFound) {
            if (line.indexOf("either in-game or on the Steam Community Market") > -1) {
                immediateSaleFound = true;
                immediateSale = line.indexOf("Note: Items purchased for") == -1;
            }
        }
        if (!listingFound) {
            int listingStart = line.indexOf("g_rgListingInfo");
            if (listingStart > -1) {
                int objectStart = line.indexOf('{', listingStart);
                if (objectStart > -1) {
                    listingInfo = om.readTree(line.substring(objectStart, line.length() - 1));
                    listingFound = true;
                }
            }
        }
        if (!salesFound) {
            int salesStart = line.indexOf("line1");
            if (salesStart > -1) {
                int objectStart = line.indexOf('[', salesStart);
                if (objectStart <= -1) {
                    continue;
                }
                priceHistoryInfo = om.readTree(line.substring(objectStart, line.length() - 1));
                salesFound = true;
            }
        }
    }
    if (!salesFound) {
        logger.warn("No sales info found!");
    }
    if (!listingFound) {
        logger.warn("No listing info found!");
    }
    if (!(salesFound && listingFound) && logger.isDebugEnabled()) {
        logger.debug("Content: " + stringBuilder.toString());
        try (PrintWriter printWriter = new PrintWriter(new File("listing-page-" + new Random().nextLong() + ".html"))) {
            printWriter.print(stringBuilder.toString());
            printWriter.flush();
        }
    }
}

[Buggy Hunk]
try (PrintWriter printWriter = new PrintWriter(new File("listing-page-" + new Random().nextLong() + ".html"))) {

[Patch]
try (PrintWriter printWriter = new PrintWriter(new File("listing-page-" + random.nextLong() + ".html"))) {