[Demonstration 1]

[Buggy Method]
@Override
public FREObject call(FREContext arg0, FREObject[] arg1) {
    Rect r = new Rect();
    View rootview = arg0.getActivity().getWindow().getDecorView();
    rootview.getWindowVisibleDisplayFrame(r);
    int YNumber = r.bottom;
    FREObject Y = null;
    try {
        Y = FREObject.newObject(YNumber);
    } catch (IllegalStateException e) {
        Log.d(tag, e.getMessage());
        e.printStackTrace();
    } catch (FREWrongThreadException e) {
        e.printStackTrace();
    }
    Log.d(tag, YNumber + " ");
    return Y;
}

[Buggy Hunk]
int YNumber = r.bottom;

[Patch]
int YNumber = r.bottom - getNavigationBarSize(arg0.getActivity().getApplicationContext()).y;

[Demonstration 2]

[Buggy Method]
public RectF getRange(ArrayList<XYdata> xy, boolean logScaleX, boolean logScaleY) {
    RectF r = new RectF();
    r.left = defaultxMin;
    r.right = defaultxMax;
    r.bottom = defaultyMin;
    r.top = defaultyMax;
    if ((xy != null) && (xy.size() > 0)) {
        boolean foundone = false;
        for (int i = 0; i < xy.size(); i++) {
            if (xy.get(i).points > 1) {
                RectF rn = xy.get(i).getRange();
                if (!foundone) {
                    r.set(rn);
                    foundone = true;
                } else {
                    r.union(rn);
                }
            }
        }
    }
    if (r.left >= r.right)
        r.right = r.left + 1;
    if (r.bottom >= r.top)
        r.top = r.bottom + 1;
    if (logScaleX) {
        if (r.left <= 0)
            r.left = defaultxMin;
        if (r.left >= r.right)
            r.right = r.left + 1;
    }
    if (logScaleY) {
        if (r.bottom <= 0)
            r.bottom = defaultyMin;
        if (r.bottom >= r.top)
            r.top = r.bottom + 1;
    }
    r.top *= displayScale;
    r.bottom *= displayScale;
    r.top += displayOfs;
    r.bottom += displayOfs;
    return r;
}

[Buggy Hunk]
public RectF getRange(ArrayList<XYdata> xy, boolean logScaleX, boolean logScaleY) {

[Patch]
protected RectF getRange(ArrayList<XYdata> xy, boolean logScaleX, boolean logScaleY) {

[Demonstration 3]

[Buggy Method]
public void drawNum(int number, int i, int j) {
    if ((number < 0) || (number > 9) || i < 0 || j < 0 || this.bits[j * 9 + i]) {
        return;
    }
    this.number = number;
    this.tmp[j * 9 + i] = this.number;
}

[Buggy Hunk]
if ((number < 0) || (number > 9) || i < 0 || j < 0 || this.bits[j * 9 + i]) {

[Patch]
if ((number < 0) || (number > 9) || i < 0 || j < 0) {