[Demonstration 1]

[Buggy Method]
public void showp(Part p, int depth) {
    String tab = "";
    for (int i = 0; i < depth; i++) {
        tab += "  ";
    }
    System.out.println(tab + "Id: " + p.getId());
    System.out.println(tab + "Name: " + p.getName());
    System.out.println(tab + "Description: " + p.getDesc());
    System.out.println(tab + "Part quantity: " + p.getQuant());
    if (p.getSubPart() != null && p.getSubPart().length > 0) {
        System.out.println(tab + "Sub Parts:");
        for (Part s : p.getSubPart().toArray()) {
            this.showp(s, depth + 1);
        }
    }
}

[Buggy Hunk]
if (p.getSubPart() != null && p.getSubPart().length > 0) {

[Patch]
if (p.getSubPart() != null && p.getSubPart().size() > 0) {

[Demonstration 2]

[Buggy Method]
@Override
protected DateTime getMidpoint(DateTime pos1, DateTime pos2) {
    return new DateTime((long) (0.5 * (pos1.getMillis() + pos2.getMillis())));
}

[Buggy Hunk]
return new DateTime((long) (0.5 * (pos1.getMillis() + pos2.getMillis())));

[Patch]
return new DateTime((long) (0.5 * (pos1.getMillis() + pos2.getMillis())), chronology);

[Demonstration 3]

[Buggy Method]
public JSONObject send_post() {
    HttpClient httpClient = HttpClientBuilder.create().build();
    JSONObject jsonObject = null;
    try {
        HttpPost request = new HttpPost(this.URL + this.object_type + this.request_type);
        StringEntity params = null;
        if (this.request_type.equals("/get")) {
            String output = String.format("{\"accountId\":\"%s\"}", ad_Account_Id);
            params = new StringEntity(output, "UTF-8");
        } else if (this.request_type.equals("/set")) {
            String output = String.format("{\"accountId\":\"%s\",\"operands\":[{\"id\":%s,\"name\":\"%s\"}]}", ad_Account_Id, this.params[0], this.params[1]);
            if (this.params[1].equals("OptimizationOff")) {
                output = String.format("{\"accountId\":\"%s\",\"operands\":[{\"id\":%s,\"bidOptimizationType\":\"%s\"}]}", ad_Account_Id, this.params[0], "NONE");
            } else if (this.params[1].equals("OptimizationOn")) {
                output = String.format("{\"accountId\":\"%s\",\"operands\":[{\"id\":%s,\"bidOptimizationType\":\"%s\",\"bidOptimizationGoal\":\"%s\"}]}", ad_Account_Id, this.params[0], this.params[2], this.params[3]);
            }
            if (object_type.equals("/ads")) {
                output = String.format("{\"accountId\":\"5514\",\"operands\":[{\"id\":%s,\"bidAmount\":\"%s\"}]}", this.params[0], this.params[1]);
            }
            params = new StringEntity(output, "UTF-8");
        }
        params.setContentType("application/json");
        request.addHeader("content-type", "application/json");
        request.addHeader("Authorization", "Bearer " + this.Access_Token);
        request.setEntity(params);
        HttpResponse response = httpClient.execute(request);
        BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
        StringBuffer result = new StringBuffer();
        String line = "";
        while ((line = rd.readLine()) != null) {
            result.append(line);
        }
        System.out.println("API Resonse :" + result.toString());
        jsonObject = new JSONObject(result.toString());
    } catch (Exception ex) {
        ex.printStackTrace();
    } finally {
    }
    return jsonObject;
}

[Buggy Hunk]
output = String.format("{\"accountId\":\"5514\",\"operands\":[{\"id\":%s,\"bidAmount\":\"%s\"}]}",

[Patch]
output = String.format("{\"accountId\":\"%s\",\"operands\":[{\"id\":%s,\"bidAmount\":\"%s\"}]}",ad_Account_Id,