[Demonstration 1]

[Buggy Method]
protected Bitmap doInBackground(Object[] params) {
    // open bitmap
    final Bitmap bitmap = BitmapFactory.decodeResource(m_activity.getResources(), R.drawable.graphic);
    // create canvas
    Canvas canvas = new Canvas(bitmap);
    Integer canvasHeight = canvas.getHeight();
    Integer canvasWidth = canvas.getWidth();
    // create CanvasObject to convert object coordinates
    CanvasObject dateText = new CanvasObject(canvas, BITMAP_ORIGIN_WIDTH, BITMAP_ORIGIN_HEIGHT);
    //  create Paint for text
    Paint textPaint = new Paint();
    textPaint.setTextSize(dateText.getSize(ORIGIN_TEXT_SIZE));
    textPaint.setColor(Color.BLACK);
    // get current time and calculate time of graphic begin
    Date curDate = new Date();
    Integer curTime = (int) (curDate.getTime() / TermoBroadCastReceiver.DIVISOR_ML_SEC);
    Integer beginTime = curTime - m_interval;
    //  convert number of seconds to time string
    String beginString = timeToString(beginTime, "yyyy-MM-dd HH:mm:ss");
    //  draw graphic begin time string
    canvas.drawText("From " + beginString, dateText.getX(DATE_ORIGIN_X), dateText.getY(DATE_ORIGIN_Y), textPaint);
    // get amount of  data from interval in DB
    //  connect to DB
    DBHelper dbHelper = new DBHelper(m_activity);
    SQLiteDatabase db = dbHelper.getWritableDatabase();
    // query all data from TERMO TABLE
    String selection = DBHelper.DATE_TERMO_ROW_NAME + ">" + beginTime;
    Cursor cursor = db.query(DBHelper.TERMO_TABLE_NAME, null, selection, null, null, null, null);
    Integer numberOfData = cursor.getCount();
    Log.d(LOG_TAG, "Amount of  data from interval in DB: " + numberOfData);
    // create CanvasObject to convert object coordinates
    CanvasObject graphic = new CanvasObject(canvas, BITMAP_ORIGIN_WIDTH, BITMAP_ORIGIN_HEIGHT);
    // get data and draw the rectangles
    if (numberOfData > 0) {
        drawRects(canvas, graphic, cursor, numberOfData);
    }
    cursor.close();
    //  close connection to DB
    dbHelper.close();
    return bitmap;
}

[Buggy Hunk]
final Bitmap bitmap = BitmapFactory.decodeResource(m_activity.getResources(), R.drawable.graphic);

[Patch]
Bitmap bitmap = BitmapFactory.decodeResource(m_activity.getResources(), R.drawable.graphic);

[Demonstration 2]

[Buggy Method]
public double dot(Vector2D second) {
    return x * second.getY() + y * second.getX();
}

[Buggy Hunk]
return x*second.getY()+y*second.getX();

[Patch]
return x*second.getX()+y*second.getY();

[Demonstration 3]

[Buggy Method]
public static ItemStack findVialStackInInventory(Entity entity, Essence type) {
    // Check if the entity is actually a player
    if (entity instanceof EntityPlayer) {
        // Cast entity to EntityPlayer so that we can access the players inventory
        EntityPlayer player = (EntityPlayer) entity;
        // loop through the players inventory
        for (int i = 0; i < player.inventory.getSizeInventory(); i++) {
            // get the currently selected item in the players inventory
            ItemStack stackAt = player.inventory.getStackInSlot(i);
            // check that the current stack isnt null to prevent NullPointerExceptions
            if (stackAt != null) {
                // check if the stack actually is a vial
                if (stackAt.getItem() instanceof ItemVial) {
                    // check that the vial already has some essence
                    if (((ItemVial) stackAt.getItem()).hasType() && ((ItemVial) stackAt.getItem()).getVialType() == type) {
                        return stackAt;
                    }
                }
            }
        }
        // if no full vials were found
        for (int i = 0; i < player.inventory.getSizeInventory(); i++) {
            // get the currently selected item in the players inventory
            ItemStack stackAt = player.inventory.getStackInSlot(i);
            // check that the current stack isnt null to prevent NullPointerExceptions
            if (stackAt != null) {
                // check if the stack actually is a vial
                if (stackAt.getItem() instanceof ItemVial) {
                    return stackAt;
                }
            }
        }
    }
    return null;
}

[Buggy Hunk]
if (stackAt.getItem() instanceof ItemVial){

[Patch]
if (stackAt.getItem() instanceof ItemVial && !(((ItemVial)stackAt.getItem()).hasType())){