[Demonstration 1]

[Buggy Method]
public static boolean deleteFromRightJoinTable(Stream stream, HashMap<String, String> myMap2, String rightJName, JSONObject json, boolean fromDelete) {
    int position = VmXmlHandler.getInstance().getrJSchema().getList("dbSchema.tableDefinition.name").indexOf(rightJName);
    if (position != -1) {
        String temp = "dbSchema.tableDefinition(";
        temp += Integer.toString(position);
        temp += ")";
        String rightPkName = temp + ".primaryKey.right";
        rightPkName = VmXmlHandler.getInstance().getrJSchema().getString(rightPkName);
        String rightPkType = temp + ".primaryKey.rightType";
        rightPkType = VmXmlHandler.getInstance().getrJSchema().getString(rightPkType);
        String rightPkValue = "";
        // 4. for each entry in item_list2, create insert statement for each
        // entry to add a new row
        rightPkValue = Utils.getColumnValueFromDeltaStream(stream.getDeltaDeletedRow(), rightPkName, rightPkType, "");
        for (Map.Entry<String, String> entry : myMap2.entrySet()) {
            switch(rightPkType) {
                case "text":
                    rightPkValue = "'" + entry.getKey() + "'";
                    break;
                case "varchar":
                    rightPkValue = "'" + entry.getKey() + "'";
                    break;
                default:
                    rightPkValue = entry.getKey();
                    break;
            }
            String tuple = "(" + 0 + "," + rightPkValue + ")";
            Utils.deleteEntireRowWithPK((String) json.get("keyspace"), rightJName, rightPkName, tuple);
        }
    }
    return true;
}

[Buggy Hunk]
rightPkValue = Utils.getColumnValueFromDeltaStream(stream.getDeltaDeletedRow(), rightPkName, rightPkType, "");

[Patch]
rightPkValue = Utils.getColumnValueFromDeltaStream(stream.getDeltaUpdatedRow(), rightPkName, rightPkType, "");

[Demonstration 2]

[Buggy Method]
public static User fromJSON(JSONObject json) {
    User u = new User();
    try {
        u.name = json.getString("name");
        u.uid = json.getLong("id");
        u.screenName = json.getString("screen_name");
        u.profileImageUrl = json.getString("profile_image_url");
        u.tagline = json.getString("description");
        u.followersCount = json.getInt("followers_count");
        u.followingsCount = json.getInt("friends_count");
    } catch (JSONException e) {
        e.printStackTrace();
    }
    return u;
}

[Buggy Hunk]
u.followingsCount = json.getInt("friends_count");

[Patch]
u.followingCount = json.getInt("friends_count");