[Demonstration 1]

[Buggy Method]
public void visit(BinaryExpression ast) {
    ast.getLHS().accept(this);
    ast.getRHS().accept(this);
    Type lType = ast.getLHS().getType();
    Type rType = ast.getRHS().getType();
    ClassSymbol STRING_TYPE = fetch("String");
    BinaryOperator op = ast.getOperator();
    if (op.undergoesBinaryPromotion()) {
        if (op == BinaryOperator.ADDITION && (lType.equals(STRING_TYPE) || rType.equals(STRING_TYPE))) {
            ast.setType(STRING_TYPE);
        } else {
            if (!isNumericLike(lType)) {
                addError(ast.getLHS(), "The " + op + " operator expects a left hand side with numeric type", "Change the left hand side to result in a numeric type");
            } else if (!isNumericLike(rType)) {
                addError(ast.getRHS(), "The " + op + " operator expects a right hand side with numeric type", "Change the right hand side to result in a numeric type");
            } else {
                Type ret = binaryPromotion(ast.getLHS(), ast.getRHS());
                if (op.isRelational()) {
                    ast.setType(PrimitiveType.BOOLEAN);
                } else {
                    ast.setType(ret);
                }
            }
        }
    } else if (op.isShift()) {
        lType = unaryPromotion(ast.getLHS());
        rType = unaryPromotion(ast.getRHS());
        if (!lType.equals(PrimitiveType.INT)) {
            addError(ast.getLHS(), "The " + op + " shift operand expects a left hand with int type", "Change the left hand side to result in a numeric type");
        } else if (!rType.equals(PrimitiveType.INT)) {
            addError(ast.getRHS(), "The " + op + " shift operand expects a right hand with int type", "Change the right hand side to result in a numeric type");
        }
        ast.setType(lType);
    } else if (op == BinaryOperator.INSTANCE_OF) {
        if (!lType.isReference() && lType != NilType.TYPE) {
            addError(ast.getLHS(), "The left hand side of the instanceof operator must be of a reference type or null", "Change the left hand side to be a reference type or null");
        } else if (!rType.isReference() || !rType.isReifiable()) {
            addError(ast.getRHS(), "The right hand side of the instanceof operator must be a reifiable reference type", "Change the right hand side to be a reifiable reference type");
        } else if (!canCast(lType, rType)) {
            addError(ast, "The left hand side could never be an instance of the right hand side", "Change either side such that the left hand side could be an instance of the right hand side");
        }
        ast.setType(PrimitiveType.BOOLEAN);
    } else if (op.isEquality()) {
        if ((isNumericLike(lType) && isNumericLike(rType)) || (isBooleanLike(lType) && isBooleanLike(rType))) {
            ast.setType(PrimitiveType.BOOLEAN);
        } else if ((lType.isReference() || lType == NilType.TYPE) && (rType.isReference() || rType == NilType.TYPE)) {
            if (lType != NilType.TYPE && rType != NilType.TYPE && !canCast(lType, rType)) {
                addError(ast, "The left hand side could never be equal to the right hand side", "Change either side such that they could be equal or use the 'equals' method");
            }
            ast.setType(PrimitiveType.BOOLEAN);
        } else {
            addError(ast, "The " + op + " operator expects reference types or numeric types", "Provide reference types or numeric types");
        }
    } else if (op.isBitwise()) {
        if ((isNumericLike(lType) && isNumericLike(rType)) || (isBooleanLike(lType) && isBooleanLike(rType))) {
            ast.setType(binaryPromotion(ast.getLHS(), ast.getRHS()));
        } else {
            addError("The bitwise operator, " + op + ", requires two numbers or two booleans", "Provide two numbers or two boolean values");
        }
    } else if (op.isLogical()) {
        if (isBooleanLike(lType) && isBooleanLike(rType)) {
            ast.setType(binaryPromotion(ast.getLHS(), ast.getRHS()));
        }
    }
}

[Buggy Hunk]
ast.setType(binaryPromotion(ast.getLHS(), ast.getRHS()));

[Patch]
ast.setType(PrimitiveType.BOOLEAN);

[Demonstration 2]

[Buggy Method]
private String preprocessLocationStatement(final String invariant) {
    String inv = invariant.replaceAll(":=", "==");
    inv = inv.replaceAll("&&", "&");
    return inv;
}

[Buggy Hunk]
private String preprocessLocationStatement(final String invariant) {

[Patch]
private static String preprocessLocationStatement(final String invariant) {

[Demonstration 3]

[Buggy Method]
public Object react(Action action) throws Exception {
    if (action.isAllowEncode()) {
        Encodings encodings = action.getContentEncodings().clone();
        Encodings availables = new Encodings(map.keySet());
        if (encodings.isEmpty() == false) {
            encodings.retainAll(availables);
        } else {
            encodings = availables;
        }
        if (encodings.isEmpty()) {
            Encodings expects = action.getContentEncodings();
            Encodings actuals = availables;
            throw new NoSuchCodecException(expects, actuals);
        }
        Encoding encoding = encodings.first();
        ResponseEncoder encoder = map.get(encoding);
        Response source = action.getResponse();
        Response target = new EncodedServletResponse((JestfulServletResponse) source, encoding, encoder);
        target.setResponseHeader("Content-Encoding", encoding.toString(false));
        action.setResponse(target);
    }
    return action.execute();
}

[Buggy Hunk]
Encodings expects = action.getContentEncodings();

[Patch]
Encodings expects = action.getContentEncodings().clone();