[Demonstration 1]

[Buggy Method]
public static void sendData() {
    Json jsonObj = new Json(JsonWriter.OutputType.json);
    jsonObj.setUsePrototypes(false);
    String json = jsonObj.toJson(allData);
    System.out.println(allData.size());
    HttpRequestBuilder requestBuilder = new HttpRequestBuilder();
    HttpRequest httpRequest = requestBuilder.newRequest().method(HttpMethods.POST).url(DATA_URL).header("Content-Type", "application/json").header("accept", "application/json").header("x-access-token", Config.tokenString).content(json).build();
    Gdx.net.sendHttpRequest(httpRequest, new HttpResponseListener() {

        @Override
        public void handleHttpResponse(HttpResponse httpResponse) {
            Json temp = new Json();
            temp.setUsePrototypes(false);
            System.out.println(temp.prettyPrint(allData));
        }

        @Override
        public void failed(Throwable t) {
            Gdx.app.log("DataPoster", "HTTP request failed!");
        }

        @Override
        public void cancelled() {
            // TODO Auto-generated method stub
            Gdx.app.log("DataPoster", "HTTP request cancelled!");
        }
    });
}

[Buggy Hunk]
System.out.println(allData.size());

[Patch]
System.out.println("AllData size: " + allData.size());

[Demonstration 2]

[Buggy Method]
@Test
public void createItemsRestTest() throws MalformedURLException, IOException {
    initServerStructure(knv);
    OrganizationalUnit ou = RestClient.getOrganizationalUnit("restname");
    Assert.assertEquals("restname", ou.getName());
    Assert.assertEquals("restdescr", ou.getDescription());
    Assert.assertEquals("rest@drools.org", ou.getOwner());
    Assert.assertEquals("restgroupid", ou.getGroupId());
    List<String> repoList = ou.getRepositories();
    Assert.assertEquals(2, repoList.size());
    Assert.assertEquals("restreponame", repoList.get(0));
    Assert.assertEquals("restreponame2", repoList.get(1));
    Repository repo = RestClient.getRepository("restreponame");
    Assert.assertEquals("restreponame", repo.getName());
    Assert.assertEquals("restrepodescript", repo.getDescription());
    Assert.assertEquals("restrepouser", repo.getUsername());
    Repository repo2 = RestClient.getRepository("restreponame2");
    Assert.assertEquals("restreponame2", repo2.getName());
    Assert.assertEquals("restrepodescript2", repo2.getDescription());
    Assert.assertEquals("restrepouser2", repo2.getUsername());
    Assert.assertEquals("git://restreponame2", repo.getGitUrl());
    List<Project> projectList = RestClient.getProjects("restreponame");
    Assert.assertEquals(1, projectList.size());
    Project project = projectList.get(0);
    Assert.assertEquals("restprojectname", project.getName());
    Assert.assertEquals("restprojectdescr", project.getDescription());
    Assert.assertEquals("resrprojectgid", project.getGroupId());
    Assert.assertEquals("restprojectversion", project.getVersion());
    List<Project> projectList2 = RestClient.getProjects("restreponame2");
    Assert.assertEquals(4, projectList2.size());
    Assert.assertEquals("helloworld-brms-kmodule", projectList2.get(0).getName());
    Assert.assertEquals("bpms-project", projectList2.get(1).getName());
    Assert.assertEquals("my-store-brms-kmodule", projectList2.get(2).getName());
    Assert.assertEquals("decision-table-kmodule", projectList2.get(3).getName());
}

[Buggy Hunk]
Assert.assertEquals("restdescr", ou.getDescription());

[Patch]
Assert.assertEquals("BZ1262213", "restdescr", ou.getDescription());

[Demonstration 3]

[Buggy Method]
@Override
public FREObject call(FREContext arg0, FREObject[] arg1) {
    String achievementId = null;
    int numSteps;
    try {
        achievementId = arg1[0].getAsString();
        numSteps = arg1[0].getAsInt();
    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }
    Extension.context.achievements.setStepsAchivement(achievementId, numSteps);
    return null;
}

[Buggy Hunk]
numSteps = arg1[0].getAsInt();

[Patch]
numSteps = arg1[1].getAsInt();