[Demonstration 1]

[Buggy Method]
private void init() {
    setLayerType(LAYER_TYPE_SOFTWARE, null);
    mPaint.setStyle(Paint.Style.FILL);
    mPaint.setColor(mColorNormal);
    mErase.setXfermode(PORTER_DUFF_CLEAR);
    if (!isInEditMode()) {
        mPaint.setShadowLayer(mShadowRadius, mShadowXOffset, mShadowYOffset, mShadowColor);
    }
}

[Buggy Hunk]
setLayerType(LAYER_TYPE_SOFTWARE, null);

[Patch]
ViewCompat.setLayerType(Label.this, ViewCompat.LAYER_TYPE_SOFTWARE, null);

[Demonstration 2]

[Buggy Method]
private void dfsCount(int node) {
    // From the API docs, Deque claims to be faster as a stack than java.util.Stack.
    Deque<StackScope> stack = new ArrayDeque<>();
    stack.push(new StackScope(node, rootChamber));
    while (!stack.isEmpty()) {
        StackScope sc = stack.pop();
        node = sc.getNode();
        if (visited[node]) {
            continue;
        }
        Chamber currentChamber = sc.getCurrentChamber();
        visited[node] = true;
        if (cutVertices[node]) {
            for (int child : board.freeNeighbours(node)) {
                if (!visited[child] && boardZones.isInPlayerZone(board.US, child)) {
                    // If a cut vertex has multiple children, and this loop runs twice, both must be chambers.
                    CheckerCount count = new CheckerCount(board);
                    currentChamber = new Chamber(count, currentChamber);
                    stack.push(new StackScope(child, currentChamber));
                }
            }
            //                count.add(node);
        } else {
            for (int child : board.freeNeighbours(node)) {
                if (!visited[child] && boardZones.isInPlayerZone(board.US, child)) {
                    // possibly only need first filtered child, as otherwise it would be a cutvertex.
                    stack.push(new StackScope(child, currentChamber));
                }
            }
            currentChamber.getSize().add(node);
        }
    }
}

[Buggy Hunk]
Deque<StackScope> stack = new ArrayDeque<>();

[Patch]
Deque<StackScope> stack = new ArrayDeque<>(board.getSize());

[Demonstration 3]

[Buggy Method]
@Override
public Collection<DiscoveredNode> discoverNodes() {
    Collection<DiscoveredNode> list = new LinkedList<>();
    Properties empty = new Properties();
    if (this.agentClient != null) {
        try {
            ConsulResponse<List<CatalogService>> service = this.agentClient.getService(serviceName);
            LOG.log(Level.WARNING, "Resolving service: {0}", serviceName);
            for (CatalogService s : service.getResponse()) {
                if (LOG.isLoggable(Level.FINEST)) {
                    LOG.log(Level.FINEST, "Found service at: {0}", s.getAddress());
                }
                Address address = new Address(s.getAddress(), 5901);
                list.add(new SimpleDiscoveredNode(address, empty));
            }
            if (list.isEmpty()) {
                LOG.warning("No consul instances found!");
            }
            return list;
        } catch (Exception e) {
            LOG.severe(e.getMessage());
            throw ExceptionUtil.rethrow(e);
        }
    }
    return list;
}

[Buggy Hunk]
Address address = new Address(s.getAddress(), 5901);

[Patch]
Address address = new Address(s.getAddress(), s.getServicePort());