[Demonstration 1]

[Buggy Method]
public Connection updateRelationship(int userID, int friendID, Connection newRel) {
    System.out.println("In updateRelationship");
    System.out.println(newRel);
    Map relParams = new HashMap();
    relParams.put("prevTimeStamp", newRel.getPrevTimeStamp());
    relParams.put("LearntProb", newRel.getLearntProb());
    relParams.put("c0", newRel.getC0());
    relParams.put("alpha", newRel.getAlpha());
    relParams.put("fk", newRel.getFk());
    relParams.put("gk", newRel.getGk());
    relParams.put("k", newRel.getGk());
    relParams.put("m", newRel.getM());
    Map res_map = Iterators.singleOrNull(cypher.query("MATCH (:USER {UserID:{UserID}})<-[r]-" + "(:USER {UserID:{FriendID}})\n" + " SET r={newRel}" + " RETURN r", map("UserID", userID, "FriendID", friendID, "newRel", relParams)));
    if (res_map == null)
        return null;
    Map connection = (Map) res_map.get("r");
    Connection connection_res = new Connection.ConnectionBuilder().prevTime((long) connection.get("prevTimeStamp")).learntProb(convertToDoubleArray((Iterable) connection.get("LearntProb"))).c0(convertToDoubleArray((Iterable) connection.get("c0"))).alpha(convertToDoubleArray((Iterable) connection.get("alpha"))).fk(convertToDoubleArray((Iterable) connection.get("fk"))).gk(convertToDoubleArray((Iterable) connection.get("gk"))).k(convertToIntArray((Iterable) connection.get("k"))).m(convertToIntArray((Iterable) connection.get("m"))).createConnection();
    return connection_res;
}

[Buggy Hunk]
relParams.put("k", newRel.getGk());

[Patch]
relParams.put("k", newRel.getK());

[Demonstration 2]

[Buggy Method]
@Override
public void defineOwnProperty(Context cx, Object id, ScriptableObject desc) {
    if (dense != null) {
        Object[] values = dense;
        dense = null;
        denseOnly = false;
        for (int i = 0; i < values.length; i++) {
            if (values[i] != NOT_FOUND) {
                put(i, this, values[i]);
            }
        }
    }
    int index = toIndex(id);
    if (index >= length) {
        length = index + 1;
    }
    super.defineOwnProperty(cx, id, desc);
}

[Buggy Hunk]
int index = toIndex(id);

[Patch]
long index = toArrayIndex(id);

[Demonstration 3]

[Buggy Method]
public static boolean deleteProduct(String id) {
    boolean exist = false;
    if (map.containsKey(id)) {
        int index = 0;
        for (int i = 0; i < proList.size(); i++) {
            if (proList.get(i).getID().equals(id))
                index = i;
        }
        proList.remove(index);
        map.remove(id);
        exist = true;
    }
    return exist;
}

[Buggy Hunk]
public static boolean deleteProduct(String id) {

[Patch]
public boolean deleteProduct(String id) {