[Demonstration 1]

[Buggy Method]
public ChannelRequest getRequestCountGroupByChannel(String userEmail, Date beginTime, Date endTime);

[Buggy Hunk]
public ChannelRequest getRequestCountGroupByChannel(String userEmail, Date beginTime,

[Patch]
ChannelRequest getRequestCountGroupByChannel(String userEmail, Date beginTime,

[Demonstration 2]

[Buggy Method]
private void savePlayerLists(JSONObject jo) throws JSONException {
    JSONArray types = jo.getJSONArray(StateObject.type);
    abilities.clear();
    PlayerList pl = new PlayerList();
    String type;
    JSONArray jPlayers;
    JSONObject jObject;
    String name;
    Player p;
    for (int i = 0; i < types.length(); i++) {
        pl = new PlayerList();
        type = types.getString(i);
        jPlayers = jo.getJSONArray(type);
        for (int j = 0; j < jPlayers.length(); j++) {
            jObject = jPlayers.getJSONObject(j);
            name = jObject.getString(StateObject.playerName);
            isActive.put(name, jObject.getBoolean(StateObject.playerActive));
            p = iw.getPlayerByName(name);
            pl.add(p);
        }
        abilities.put(type, pl);
    }
}

[Buggy Hunk]
for(int j = 0; j < jPlayers.length(); j++){

[Patch]
for(int j = 0; j < jPlayers.length() && iw.i != null; j++){

[Demonstration 3]

[Buggy Method]
protected Object parseValue(JSONObject node) {
    String type = node.getString("type");
    if (node.has("value")) {
        String value = node.getString("value");
        //System.out.println("parseValue: '" + value + "' as " + type);
        if ("string".equals(type)) {
            return value;
        } else if ("double".equals(type)) {
            return Double.parseDouble(value);
        } else if ("int".equals(type)) {
            return Integer.parseInt(value);
        } else if ("bool".equals(type)) {
            return "1".equals(value);
        }
        return value;
    } else {
        return null;
    }
}

[Buggy Hunk]
String value = node.getString("value");

[Patch]
String value = "" + node.get("value"); // BUGFIX