[Demonstration 1]

[Buggy Method]
@Override
public void debug(String format, Object... arguments) {
    FormattingTuple ft = MessageFormatter.format(format, arguments);
    logger.debug(ft.getMessage());
}

[Buggy Hunk]
FormattingTuple ft = MessageFormatter.format(format, arguments);

[Patch]
FormattingTuple ft = MessageFormatter.arrayFormat(format, arguments);

[Demonstration 2]

[Buggy Method]
@Override
public void write(final int b) throws IOException {
    // Print to console
    mOutputStream.write(b);
    // Split sentences on newlines
    if (b == 10 || b == 13) {
        if (mTempOutput.size() > 0) {
            // Make sure the output doesn't exceed the size limit
            if (mSavedOutput.size() == NUM_LINES) {
                mSavedOutput.remove(0);
            }
            // Add time prefix
            final int[] time = sTimeFormatter.format(Calendar.getInstance().getTime()).chars().toArray();
            for (int i = 0; i < time.length; ++i) {
                mTempOutput.add(i, time[i]);
            }
            // Store line
            mSavedOutput.add(mTempOutput.toArray(new Integer[mTempOutput.size()]));
            // Prepare for the next line
            mTempOutput.clear();
        }
    } else {
        // Add temp output for processing later
        mTempOutput.add(b);
    }
}

[Buggy Hunk]
public void write(final int b) throws IOException {

[Patch]
public synchronized void write(final int b) throws IOException {

[Demonstration 3]

[Buggy Method]
static int parseNumber(JsonBinder binder, char[] s, int from, int to) {
    int i = from;
    boolean minus = s[from] == '-';
    if (minus)
        i++;
    if (i == to)
        throw new IllegalStateException("no number found, only '-'");
    boolean floatValue = false;
    long l = 0;
    char ch = 0;
    while (i < to) {
        ch = s[i];
        if (ch >= '0' && ch <= '9') {
            l = l * 10 + (ch - '0');
        } else if (ch == '.') {
            floatValue = true;
            break;
        } else
            break;
        i++;
    }
    if (binder == null)
        return i;
    double d = 0;
    if (floatValue) {
        long number = l;
        i++;
        int fractionalPartStart = i;
        while (i < to) {
            ch = s[i];
            if (ch >= '0' && ch <= '9')
                number = number * 10 + (ch - '0');
            else
                break;
            i++;
        }
        //            if (ch != '"' && ch != '\'' && ch != '}' && ch != ']' && ch != ',')
        //                throw new NumberFormatException("can't parse '" + new String(s, from, i - from + 1) + "' as number");
        if (minus)
            d = -((double) number) / fractionalShift[i - fractionalPartStart];
        else
            d = ((double) number) / fractionalShift[i - fractionalPartStart];
    }
    if (minus)
        l = -l;
    if (ch == 'e' || ch == 'E') {
        if (!floatValue) {
            d = l;
            floatValue = true;
        }
        i++;
        int degree = 0;
        minus = s[i] == '-';
        if (minus)
            i++;
        while (i < to) {
            ch = s[i];
            if (ch >= '0' && ch <= '9')
                degree = degree * 10 + (ch - '0');
            else
                break;
            i++;
        }
        d = (minus) ? d / Math.pow(10, degree) : d * Math.pow(10, degree);
    }
    JsonFieldSetter setter = binder.getFieldSetter();
    if (setter != null && setter.getType() != FieldReflection.Type.OBJECT) {
        setNumber(setter, binder.getObject(), l, d, floatValue);
        return i;
    }
    if (!floatValue)
        set(setter, binder, l);
    else
        set(setter, binder, d);
    return i;
}

[Buggy Hunk]
if (setter != null && setter.getType() != FieldReflection.Type.OBJECT) {

[Patch]
if (setter != null) {