[Demonstration 1]

[Buggy Method]
private double negascout(final MoveWrapper<M> wrapper, final int depth, final double alpha, final double beta) {
    this.nodesCount++;
    if (this.abort) {
        return this.maxEvaluateValue();
    }
    boolean isOver = isOver();
    if (depth == 0 || isOver) {
        if (isOver || isQuiet()) {
            return evaluate();
        } else {
            return quiescence(alpha, beta);
        }
    }
    int currentDepth = this.maxDepth - depth;
    double a = alpha;
    double b = beta;
    T hash = this.getTransposition();
    if (hash != null && wrapper == null) {
        TranspositionTable.Entry<M> entry = this.transpositionTable.get(hash, depth);
        if (entry != null) {
            switch(entry.type) {
                case LOWER_BOUND:
                    a = Math.max(a, entry.score);
                    break;
                case UPPER_BOUND:
                    b = Math.min(b, entry.score);
                    break;
                case EXACT_SCORE:
                    return entry.score;
            }
            if (a >= b) {
                return a;
            }
        }
    }
    if (this.killerMoves.get(currentDepth) == null) {
        this.killerMoves.put(currentDepth, new ArrayList<M>());
    }
    List<M> moves = sortMoves(getPossibleMoves(), depth);
    M bestMove = null;
    if (moves.isEmpty()) {
        next();
        double score = this.evaluate();
        previous();
        return score;
    }
    double score;
    boolean first = true;
    for (M move : moves) {
        makeMove(move);
        score = negascoutScore(first, depth, a, beta, b);
        unmakeMove(move);
        if (this.abort) {
            break;
        }
        if (wrapper != null) {
            System.out.println("[Best move is " + bestMove + ", Best score is " + a + "] [Current move is " + move + ", Current score is " + score + "]");
        }
        if (score > a) {
            a = score;
            bestMove = move;
            if (wrapper != null) {
                System.out.println("[Best move is " + bestMove + ", Best score is " + a + "]");
            }
            List<M> currentDepthKillerMoves = this.killerMoves.get(currentDepth);
            if (currentDepthKillerMoves == null) {
                currentDepthKillerMoves = new ArrayList<>();
                this.killerMoves.put(currentDepth, currentDepthKillerMoves);
            }
            if (move != null && !currentDepthKillerMoves.contains(move)) {
                if (currentDepthKillerMoves.size() >= 2) {
                    currentDepthKillerMoves.remove(1);
                }
                currentDepthKillerMoves.add(0, move);
            }
            if (a >= beta) {
                break;
            }
        } else if (first) {
            bestMove = move;
        }
        b = a + 1;
        first = false;
    }
    if (wrapper != null) {
        wrapper.move = bestMove;
    }
    if (hash != null && !this.abort) {
        TranspositionTable.Entry<M> entry = new TranspositionTable.Entry<>();
        entry.move = bestMove;
        entry.depth = depth;
        entry.score = a;
        entry.type = (a <= alpha ? TranspositionTable.EntryType.UPPER_BOUND : (a >= beta ? TranspositionTable.EntryType.LOWER_BOUND : TranspositionTable.EntryType.EXACT_SCORE));
        this.transpositionTable.put(hash, entry);
    }
    return a;
}

[Buggy Hunk]
T hash = this.getTransposition();

[Patch]
final T hash = this.getTransposition();

[Demonstration 2]

[Buggy Method]
@Override
public boolean onActivated(EntityPlayer player, EnumHand hand, ItemStack item, EnumFacing dir, float X, float Y, float Z) {
    if (world.isRemote)
        return true;
    dir = Utils.hitSide(X, Y, Z);
    byte s = (byte) dir.ordinal();
    if (player.isSneaking() && item == null) {
        boolean t = !comp.canConnect(s);
        comp.setConnect(s, t);
        comp.updateCon = true;
        this.markUpdate();
        TileEntity te = Utils.neighborTile(this, dir);
        if (te instanceof HeatPipe) {
            HeatPipeComp pipe = ((HeatPipe) te).comp;
            pipe.setConnect((byte) (s ^ 1), t);
            ((HeatPipe) te).markUpdate();
        }
        return true;
    }
    return false;
}

[Buggy Hunk]
if (player.isSneaking() && item == null) {

[Patch]
if (player.isSneaking() && item.isEmpty()) {

[Demonstration 3]

[Buggy Method]
@Override
public void onCreate(SurfaceHolder holder) {
    super.onCreate(holder);
    setWatchFaceStyle(new WatchFaceStyle.Builder(MyWatchFace.this).setCardPeekMode(WatchFaceStyle.PEEK_MODE_VARIABLE).setBackgroundVisibility(WatchFaceStyle.BACKGROUND_VISIBILITY_INTERRUPTIVE).setShowSystemUiTime(false).build());
    // Set the resources instance
    resources = MyWatchFace.this.getResources();
    mYOffset = resources.getDimension(R.dimen.digital_y_offset);
    mBackgroundPaint = new Paint();
    mBackgroundPaint.setColor(resources.getColor(R.color.background));
    // Create a typeface with the main font, set the font afterwards
    // TODO: Make a constant of this font name?
    Typeface font = Typeface.createFromAsset(getAssets(), "fonts/BebasNeue Bold.otf");
    mTextPaint = new Paint();
    mTextPaint.setTypeface(font);
    mTextPaint.setColor(resources.getColor(R.color.digital_text));
    mTextPaint.setAntiAlias(true);
    // Create the hour and minute text painters
    // TODO: Set the color and alpha of the font painters!
    mTextPaintHour = new Paint(mTextPaint);
    mTextPaintHour.setTextAlign(Paint.Align.RIGHT);
    mTextPaintHourFaded = new Paint(mTextPaintHour);
    mTextPaintHourFaded.setAlpha(255 / 10);
    mTextPaintMinute = new Paint(mTextPaint);
    mTextPaintMinute.setTextAlign(Paint.Align.LEFT);
    // Create the second glance painter
    mGlancePaint = new Paint();
    mGlancePaint.setColor(Color.WHITE);
    // TODO: Set the proper alpha here, use a resource constant!
    mGlancePaint.setAlpha(255 / 5);
    mGlancePaint.setStyle(Paint.Style.FILL);
    mGlancePaint.setAntiAlias(true);
    // Set the calendar instance
    calendar = new GregorianCalendar(TimeZone.getDefault());
    // Initialize the second glance path
    secondGlancePath = new Path();
}

[Buggy Hunk]
secondGlancePath = new Path();

[Patch]
secondGleamPath = new Path();