[Demonstration 1]

[Buggy Method]
public Group draw(PannableCanvas canvas, NodeGestures nodeGestures) {
    CoordinateDetermination cdm = new CoordinateDetermination(dbm);
    Coordinate[] coords = cdm.calcCoords();
    ArrayList<Integer> from = dbm.getDBReader().getAllFromID();
    ArrayList<Integer> to = dbm.getDBReader().getAllToID();
    int maxX = getMaxX(coords);
    int maxY = getMaxY(coords);
    Group group = new Group();
    for (int i = 0; i < from.size(); i++) {
        int fromID = from.get(i);
        int toID = to.get(i);
        System.out.println(i);
        Path path = drawPath(coords[fromID - 1], coords[toID - 1], maxX, maxY);
        path.addEventFilter(MouseEvent.MOUSE_PRESSED, nodeGestures.getOnMousePressedEventHandler());
        path.addEventFilter(MouseEvent.MOUSE_DRAGGED, nodeGestures.getOnMouseDraggedEventHandler());
        path.setStrokeWidth(dbm.getDBReader().countGenomesInLink(fromID, toID));
        canvas.getChildren().add(path);
    }
    return group;
}

[Buggy Hunk]
path.setStrokeWidth(dbm.getDBReader().countGenomesInLink(fromID, toID));

[Patch]
path.setStrokeWidth(0.01 + 0.003 * dbm.getDBReader().countGenomesInLink(fromID, toID));

[Demonstration 2]

[Buggy Method]
private TimeMap readMfraBoxFromTail(ExtractorInput input) {
    DataSource dataSource = input.getDataSource();
    if (dataSource == null || !(dataSource instanceof UriDataSource)) {
        return null;
    }
    String uriString = ((UriDataSource) dataSource).getUri();
    if (uriString == null) {
        return null;
    }
    Uri uri = Uri.parse(uriString);
    if (!Util.isLocalFileUri(uri)) {
        // Do this only the local file
        return null;
    }
    try {
        File file = new File(uri.toString());
        long size = file.length();
        FileDataSource source = new FileDataSource();
        long mfraSize = readMfroBox(source, uri, size);
        if (mfraSize <= 0) {
            // no mfra offset found
            return null;
        }
        byte[] mfraData = new byte[(int) mfraSize];
        source.open(new DataSpec(uri, size - mfraSize, mfraData.length, null));
        source.read(mfraData, 0, mfraData.length);
        source.close();
        ParsableByteArray data = new ParsableByteArray(mfraData);
        // Skip the Atom size
        data.skipBytes(4);
        long atomType = data.readInt();
        if (atomType != Atom.TYPE_mfra) {
            return null;
        }
        TimeMap timeMap = new TimeMap();
        //noinspection StatementWithEmptyBody
        while (readTfra(timeMap, data)) {
        }
        return timeMap;
    } catch (Exception e) {
        Log.w(TAG, "Error while reading Random Access Boxes at the end of the source file: " + e.getMessage(), e);
    }
    return null;
}

[Buggy Hunk]
File file = new File(uri.toString());

[Patch]
File file = new File(uri.getPath());

[Demonstration 3]

[Buggy Method]
public void open() {
    synchronized (lock) {
        if (!isOpen()) {
            if (directorySupplier == null) {
                throw new IllegalStateException("Could not open index as directory supplier is not provided");
            }
            directory = directorySupplier.get();
            owningDirectory = true;
        }
    }
}

[Buggy Hunk]
if (!isOpen()) {

[Patch]
if (directory == null) {