[Demonstration 1]

[Buggy Method]
public void toShare(View view) {
    PDFGenerator pdfGenerator = new PDFGenerator();
    MyApp app = (MyApp) getApplication();
    Document document = app.getDoc();
    TransformerFactory factory = TransformerFactory.newInstance();
    File xml = new File(getCacheDir(), "invoice.xml");
    try {
        Transformer transformer = factory.newTransformer();
        Result result = new StreamResult(xml);
        Source source = new DOMSource(document);
        transformer.transform(source, result);
    } catch (TransformerException e) {
        e.printStackTrace();
    }
    app.setXml(xml);
    File dir = new File(getApplicationInfo().dataDir);
    try {
        app.setPdf(pdfGenerator.generatePDF(app.getXslStream(), new FileInputStream(xml), dir));
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    }
    Intent intent = new Intent(this, ShareFormActivity.class);
    startActivity(intent);
}

[Buggy Hunk]
File dir = new File(getApplicationInfo().dataDir);

[Patch]
File dir = new File(String.valueOf(getFilesDir()));

[Demonstration 2]

[Buggy Method]
public static void renderHat() {
    GL11.glPushMatrix();
    GL11.glTranslatef(0, -10 / 16F, 0);
    float radius = 4 / 16F, height = 2 / 16F;
    float res = 0.7F;
    Tessellator tes = Tessellator.instance;
    tes.startDrawing(GL11.GL_TRIANGLE_FAN);
    tes.setColorRGBA_I(0x57424F, 255);
    tes.setNormal(0, -1, 0);
    tes.addVertex(0, 0, 0);
    for (float i = 0; i <= 2 * Math.PI; i += res) tes.addVertex(radius * Math.cos(i), 0, radius * Math.sin(i));
    tes.addVertex(radius, 0, 0);
    tes.draw();
    Vec3 center = Vec3.createVectorHelper(-radius, -height / 2, -radius);
    tes.startDrawing(GL11.GL_QUAD_STRIP);
    tes.setColorRGBA_I(0x57424F, 255);
    for (float i = 0; i <= 2 * Math.PI; i += res) {
        float x = (float) (radius * Math.cos(i));
        float z = (float) (radius * Math.sin(i));
        Vec3 v1 = Vec3.createVectorHelper(x, 0, z).subtract(center).normalize();
        tes.setNormal((float) v1.xCoord, (float) v1.yCoord, (float) v1.zCoord);
        tes.addVertex(x, 0, z);
        Vec3 v2 = Vec3.createVectorHelper(x, height, z).subtract(center).normalize();
        tes.setNormal((float) v2.xCoord, (float) v2.yCoord, (float) v2.zCoord);
        tes.addVertex(x, height, z);
    }
    tes.addVertex(radius, 0, 0);
    tes.addVertex(radius, height, 0);
    tes.draw();
    GL11.glPopMatrix();
}

[Buggy Hunk]
public static void renderHat() {

[Patch]
private void renderHat() {

[Demonstration 3]

[Buggy Method]
@Override
public int[] getAccessibleSlotsFromSide(int side) {
    return DimletResearcherContainer.factory.getAccessibleSlots();
}

[Buggy Hunk]
return DimletResearcherContainer.factory.getAccessibleSlots();

[Patch]
return DimensionBuilderContainer.factory.getAccessibleSlots();