[Demonstration 1]

[Buggy Method]
@Override
public void requestZoomedViewRender() {
    if (stopUpdateView) {
        return;
    }
    // remove pending runnable
    ThreadUtils.removeCallbacksFromUiThread(requestRenderRunnable);
    // "requestZoomedViewRender" can be called very often by Gecko (endDrawing in LayerRender) without
    // any thing changed in the zoomed area (useless calls from the "zoomed area" point of view).
    // "requestZoomedViewRender" can take time to re-render the zoomed view, it depends of the complexity
    // of the html on this area.
    // To avoid to slow down the application, the 2 following cases are tested:
    // 1- Last render is still running, plan another render later.
    if (isRendering()) {
        // post a new runnable DELAY_BEFORE_NEXT_RENDER_REQUEST_MS later
        // We need to post with a delay to be sure that the last call to requestZoomedViewRender will be done.
        // For a static html page WITHOUT any animation/video, there is a last call to endDrawing and we need to make
        // the zoomed render on this last call.
        ThreadUtils.postDelayedToUiThread(requestRenderRunnable, DELAY_BEFORE_NEXT_RENDER_REQUEST_MS);
        return;
    }
    // 2- Current render occurs too early, plan another render later.
    if (renderFrequencyTooHigh()) {
        // post a new runnable DELAY_BEFORE_NEXT_RENDER_REQUEST_MS later
        // We need to post with a delay to be sure that the last call to requestZoomedViewRender will be done.
        // For a page WITH animation/video, the animation/video can be stopped, and we need to make
        // the zoomed render on this last call.
        ThreadUtils.postDelayedToUiThread(requestRenderRunnable, DELAY_BEFORE_NEXT_RENDER_REQUEST_MS);
        return;
    }
    startTimeReRender = System.nanoTime();
    // Allocate the buffer if it's the first call.
    // Change the buffer size if it's not the right size.
    updateBufferSize();
    int tabId = Tabs.getInstance().getSelectedTab().getId();
    ImmutableViewportMetrics metrics = layerView.getViewportMetrics();
    PointF origin = metrics.getOrigin();
    PointF offset = metrics.getMarginOffset();
    final int xPos = (int) (origin.x - offset.x) + lastPosition.x;
    final int yPos = (int) (origin.y - offset.y) + lastPosition.y;
    GeckoEvent e = GeckoEvent.createZoomedViewEvent(tabId, xPos, yPos, viewWidth, viewHeight, ZOOM_FACTOR * metrics.zoomFactor, buffer);
    GeckoAppShell.sendEventToGecko(e);
}

[Buggy Hunk]
viewHeight, ZOOM_FACTOR * metrics.zoomFactor, buffer);

[Patch]
viewHeight, zoomFactor * metrics.zoomFactor, buffer);

[Demonstration 2]

[Buggy Method]
private static boolean isParcelableArray(Object value) {
    if (!(value instanceof SparseArray<?>)) {
        return false;
    }
    List<?> list = (ArrayList<?>) value;
    for (Object object : list) {
        if (!(object instanceof Parcelable)) {
            return false;
        }
    }
    return true;
}

[Buggy Hunk]
if (!(value instanceof SparseArray<?>)) {

[Patch]
if (!(value instanceof ArrayList<?>)) {

[Demonstration 3]

[Buggy Method]
public static String getType() {
    return type;
}

[Buggy Hunk]
public static String getType(){

[Patch]
public String getType(){