[Demonstration 1]

[Buggy Method]
public void handleCryptoResult(int requestCode, int resultCode, Intent data) {
    if (requestCode != REQUEST_CODE_CRYPTO) {
        return;
    }
    if (resultCode == Activity.RESULT_OK) {
        decryptOrVerifyNextPart();
    } else {
        onCryptoFailed(new OpenPgpError(OpenPgpError.CLIENT_SIDE_ERROR, context.getString(R.string.openpgp_cancel_by_user)));
    }
}

[Buggy Hunk]
onCryptoFailed(new OpenPgpError(OpenPgpError.CLIENT_SIDE_ERROR, context.getString(R.string.openpgp_cancel_by_user)));

[Patch]
onCryptoFailed(new OpenPgpError(OpenPgpError.CLIENT_SIDE_ERROR, context.getString(R.string.openpgp_cancelled_by_user)));

[Demonstration 2]

[Buggy Method]
public Game loadConfig(String name) {
    toPlay = CourseLoader.loadCourse(name);
    entities = toPlay.getEntities();
    tdata = toPlay.getTerrain();
    ballPos = toPlay.getBallPos();
    holePos = toPlay.getHolePos();
    Vector3[][] params = new Vector3[entities.size() - 1][3];
    Box[] boxes = new Box[entities.size() - 1];
    Vector3[] positions = new Vector3[entities.size() - 1];
    for (int i = 1; i < entities.size(); i++) {
        params[i - 1][0] = new Vector3(0, entities.get(i).scale, 0);
        Vector3 tmpx = new Vector3(entities.get(i).scale, 0, 0);
        Vector3 tmpz = new Vector3(0, 0, entities.get(i).scale);
        params[i - 1][1] = tmpx.rotate(entities.get(i).getRotY(), 0, 1, 0);
        params[i - 1][2] = tmpz.rotate(entities.get(i).getRotY(), 0, 1, 0);
        BoxParameter tmp = new BoxParameter(params[i]);
        boxes[i - 1] = tmp.instantiate();
        Vector3f a = entities.get(i).getPosition();
        positions[i - 1] = new Vector3(a.x, a.y, a.z);
    }
    GameConfigurator config = new GameConfigurator();
    for (int i = 0; i < boxes.length; i++) {
        ArrayList<SolidTranslator> box = new ArrayList<>();
        SolidTranslator a = new SolidTranslator(boxes[i], positions[i]);
        box.add(a);
        config.addObstacle(1, box);
    }
    Vector3 pos = new Vector3(holePos.x, holePos.y, holePos.z);
    config.setHole(pos, 20);
    String pName = JOptionPane.showInputDialog("Player 1 Name?");
    config.addPlayerAndBall(pName, entities.get(0).getScale(), 1, new Vector3(ballPos.x, ballPos.y, ballPos.z));
    TerrainGeometryCalc calc = new TerrainGeometryCalc();
    config.setTerrain(calc.getAllTris(tdata));
    return config.game();
}

[Buggy Hunk]
config.addObstacle(1, box);

[Patch]
config.addObstacle(box);

[Demonstration 3]

[Buggy Method]
@Override
public void onUpdate() {
    super.onUpdate();
    if (worldObj.isRemote) {
        if (structure != null && clientHasStructure && isRendering) {
            float targetScale = (float) (structure.fluidStored != null ? structure.fluidStored.amount : 0) / clientCapacity;
            if (Math.abs(prevScale - targetScale) > 0.01) {
                prevScale = (9 * prevScale + targetScale) / 10;
            }
        }
        if (!clientHasStructure || !isRendering) {
            for (ValveData data : valveViewing) {
                TileEntityDynamicTank tileEntity = (TileEntityDynamicTank) data.location.getTileEntity(worldObj);
                if (tileEntity != null) {
                    tileEntity.clientHasStructure = false;
                }
            }
            valveViewing.clear();
        }
    }
    if (!worldObj.isRemote) {
        if (structure != null) {
            if (structure.fluidStored != null && structure.fluidStored.amount <= 0) {
                structure.fluidStored = null;
                markDirty();
            }
            if (isRendering) {
                boolean needsValveUpdate = false;
                for (ValveData data : structure.valves) {
                    if (data.activeTicks > 0) {
                        data.activeTicks--;
                    }
                    if (data.activeTicks > 0 != data.prevActive) {
                        needsValveUpdate = true;
                    }
                    data.prevActive = data.activeTicks > 0;
                }
                if (needsValveUpdate || structure.needsRenderUpdate()) {
                    sendPacketToRenderer();
                }
                structure.prevFluid = structure.prevFluid != null ? structure.fluidStored.copy() : null;
                manageInventory();
            }
        }
    }
}

[Buggy Hunk]
structure.prevFluid = structure.prevFluid != null ? structure.fluidStored.copy() : null;

[Patch]
structure.prevFluid = structure.prevFluid == null && structure.fluidStored != null ? structure.fluidStored.copy() : null;