[Demonstration 1]

[Buggy Method]
private boolean configVariables(String var, JsonNode toSet) {
    if (toSet.isValueNode()) {
        //            log.info("Is a value Node: "+var);
        return config.get(var);
    }
    if (toSet.isObject()) {
        Iterator<Entry<String, JsonNode>> iter = ((ObjectNode) toSet).fields();
        boolean ok = true;
        while (iter.hasNext()) {
            Entry<String, JsonNode> field = iter.next();
            if (field.getValue().isValueNode()) {
                //leaf - check config
                if (config.containsKey(var + "/" + field.getKey()))
                    ok = ok && config.get(var + "/" + field.getKey());
                else {
                    //                        log.info("Config non contiene "+var+"/"+field.getKey());
                    ok = true;
                }
                //Check if the current value is a static list key
                String currentKey = var + "/" + field.getKey();
                if (staticListIndexes.containsKey(currentKey))
                    staticListIndexes.replace(currentKey, field.getValue());
            } else
                ok = ok && configVariables(var + "/" + field.getKey(), field.getValue());
        }
        return ok;
    } else {
        Iterator<JsonNode> children = ((ArrayNode) toSet).elements();
        boolean ok = true;
        while (children.hasNext()) {
            var = (var.endsWith("]")) ? var : var + "[]";
            ok = ok && configVariables(var, children.next());
        }
        return ok;
    }
}

[Buggy Hunk]
staticListIndexes.replace(currentKey, field.getValue());

[Patch]
staticListIndexes.replace(currentKey, field.getValue().toString());

[Demonstration 2]

[Buggy Method]
@When("Retrieve Json path $expression response")
@Then("Retrieve Json path $expression response")
public void RetrieveJsonvalue(String expression) throws JSONException {
    // JsonReader.GenerateJson("sql_get_all_users");
    JsonValue = JsonPath.parse(StringjsonResponse).read(expression, String.class);
    System.err.println("The value for the created item is: " + JsonValue);
}

[Buggy Hunk]
JsonValue = JsonPath.parse(StringjsonResponse).read(expression,

[Patch]
response = JsonPath.parse(StringjsonResponse).read(expression,