[Demonstration 1]

[Buggy Method]
private AppOutputWithScreenshot getAppOutputWithScreenshot(Region region, EyesScreenshot lastScreenshot) {
    logger.verbose("getting screenshot...");
    // Getting the screenshot (abstract function implemented by each SDK).
    EyesScreenshot screenshot = getScreenshot();
    logger.verbose("Done getting screenshot!");
    // Cropping by region if necessary
    if (!region.isEmpty()) {
        screenshot = screenshot.getSubScreenshot(region, region.getCoordinatesType(), false);
    }
    logger.verbose("Compressing screenshot...");
    String compressResult = compressScreenshot64(screenshot, lastScreenshot);
    logger.verbose("Done! Getting title...");
    String title = getTitle();
    logger.verbose("Done!");
    AppOutputWithScreenshot result = new AppOutputWithScreenshot(new AppOutput(title, compressResult), screenshot);
    logger.verbose("Done!");
    return result;
}

[Buggy Hunk]
screenshot = screenshot.getSubScreenshot(region, region.getCoordinatesType(), false);

[Patch]
screenshot = screenshot.getSubScreenshot(region, false);

[Demonstration 2]

[Buggy Method]
@Override
public List<QueryResult> getAllByRegionList(List<Region> regions, QueryOptions options) {
    /**
     */
    String chunkIdSuffix = Integer.parseInt(applicationProperties.getProperty("CELLBASE." + version.toUpperCase() + ".GENOME_SEQUENCE.CHUNK_SIZE", "2000")) / 1000 + "k";
    /**
     */
    List<DBObject> queries = new ArrayList<>();
    List<String> ids = new ArrayList<>(regions.size());
    List<String> chunkIds;
    List<Integer> integerChunkIds;
    for (Region region : regions) {
        chunkIds = new ArrayList<>();
        integerChunkIds = new ArrayList<>();
        // positions below 1 are not allowed
        if (region.getStart() < 1) {
            region.setStart(1);
        }
        if (region.getEnd() < 1) {
            region.setEnd(1);
        }
        /**
         */
        int regionChunkStart = getChunk(region.getStart());
        int regionChunkEnd = getChunk(region.getEnd());
        for (int chunkId = regionChunkStart; chunkId <= regionChunkEnd; chunkId++) {
            String chunkIdStr = region.getChromosome() + "_" + chunkId + "_" + chunkIdSuffix;
            chunkIds.add(chunkIdStr);
            integerChunkIds.add(chunkId);
        }
        QueryBuilder builder = QueryBuilder.start("sequenceName").is(region.getChromosome()).and("chunkId").in(chunkIds);
        //            QueryBuilder builder = QueryBuilder.start("chromosome").is(region.getSequenceName()).and("chunkId").in(integerChunkIds);
        /**
         */
        //            QueryBuilder builder = QueryBuilder.start("chromosome").is(region.getSequenceName()).and("chunkId")
        //                    .greaterThanEquals(getChunk(region.getStart())).lessThanEquals(getChunk(region.getEnd()));
        queries.add(builder.get());
        ids.add(region.toString());
        logger.info(builder.get().toString());
    }
    List<QueryResult> queryResults = executeQueryList(ids, queries, options);
    for (int i = 0; i < regions.size(); i++) {
        Region region = regions.get(i);
        QueryResult queryResult = queryResults.get(i);
        BasicDBList list = (BasicDBList) queryResult.get("result");
        System.out.println(list.toString());
        StringBuilder sb = new StringBuilder();
        for (int j = 0; j < list.size(); j++) {
            BasicDBObject chunk = (BasicDBObject) list.get(j);
            sb.append(chunk.get("sequence"));
        }
        int startStr = getOffset(region.getStart());
        int endStr = getOffset(region.getStart()) + (region.getEnd() - region.getStart()) + 1;
        String subStr = "";
        if (getChunk(region.getEnd()) > 0) {
            if (sb.toString().length() > 0 && sb.toString().length() >= endStr) {
                subStr = sb.toString().substring(startStr, endStr);
            }
        } else {
            if (sb.toString().length() > 0 && sb.toString().length() + 1 >= endStr) {
                subStr = sb.toString().substring(startStr - 1, endStr - 1);
            }
        }
        GenomeSequenceFeature genomeSequenceFeature = new GenomeSequenceFeature(region.getChromosome(), region.getStart(), region.getEnd(), 1, ((BasicDBObject) list.get(0)).getString("sequenceType"), ((BasicDBObject) list.get(0)).getString("assembly"), subStr);
        //            GenomeSequenceChunk genomeSequenceChunk = new GenomeSequenceChunk(region.getSequenceName(), region.getStart(), region.getEnd(), subStr);
        queryResult.setResult(genomeSequenceFeature);
    }
    return queryResults;
}

[Buggy Hunk]
if (getChunk(region.getEnd()) > 0) {

[Patch]
if (getChunk(region.getStart()) > 0) {

[Demonstration 3]

[Buggy Method]
public void message(String what, boolean err) {
    // now handled in Console
    /*
    if (err) {
      Console.systemErr.print(what);
    } else {
      Console.systemOut.print(what);
    }
    */
    if (err && (what.contains("invalid context 0x0") || (what.contains("invalid drawable")))) {
        // Respectfully declining... This is a quirk of more recent releases of
        // Java on Mac OS X, but is widely reported as the source of any other
        // bug or problem that a user runs into. It may well be a Processing
        // bug, but until we know, we're suppressing the messages.
    } else if (err && what.contains("Make pbuffer:")) {
        // Remove initalization warning from LWJGL.
    } else if (err && what.contains("XInitThreads() called for concurrent")) {
        // "Info: XInitThreads() called for concurrent Thread support" message on Linux
    } else if (!err && what.contains("Listening for transport dt_socket at address")) {
        // Message from the JVM about the socket launch for debug
        // Listening for transport dt_socket at address: 8727
    } else {
        // Append a piece of text to the console. Swing components are NOT
        // thread-safe, and since the MessageSiphon instantiates new threads,
        // and in those callbacks, they often print output to stdout and stderr,
        // which are wrapped by EditorConsoleStream and eventually leads to
        // EditorConsole.appendText(), which directly updates the Swing text
        // components, causing deadlock. Updates are buffered to the console and
        // displayed at regular intervals on Swing's event-dispatching thread.
        // (patch by David Mellis)
        consoleDoc.appendString(what, err ? errStyle : stdStyle);
    }
}

[Buggy Hunk]
public void message(String what, boolean err) {

[Patch]
synchronized public void message(String what, boolean err) {