[Demonstration 1]

[Buggy Method]
private LinkedList<Tuple> helpPath(int startx, int starty, int endx, int endy) {
    //initialize the open list
    if (endx > width || endy > height || endx < 0 || endy < 0) {
        return null;
    }
    if (!mask[endx][endy]) {
        return null;
    }
    PriorityQueue<Node> open = new PriorityQueue<>();
    //initialize the closed list
    PriorityQueue<Node> closed = new PriorityQueue<>();
    //put the starting node on the open list (you can leave its f at zero)
    open.add(new Node(startx, starty, 0, optimalDistance(startx, starty, endx, endy), null));
    Node q;
    //while the open list is not empty
    while (!open.isEmpty()) {
        //find the node with the least f on the open list, call it "q"
        //pop q off the open list
        q = open.poll();
        //generate q's 8 successors and set their parents to q
        //for each successor
        //successor.g = q.g + distance between successor and q
        //successor.h = distance from goal to successor
        //successor.f = successor.g + successor.h
        LinkedList<Node> successorList = successors(q, endx, endy);
        for (Node s : successorList) {
            boolean add = true;
            //if successor is the goal, stop the search
            //if a node with the same position as successor is in the OPEN list \
            //which has a lower f than successor, skip this successor
            if (s.x == endx && s.y == endy) {
                LinkedList<Tuple> ret = new LinkedList<Tuple>();
                while (s.parent != null) {
                    ret.addFirst(new Tuple(s.x, s.y));
                    s = s.parent;
                }
                return ret;
            }
            for (Node o : open) {
                if (s.equals(o)) {
                    if (s.g >= o.g) {
                        add = false;
                    } else {
                        open.remove(o);
                    }
                    break;
                }
            }
            if (add) {
                //if a node with the same position as successor is in the CLOSED list \
                //which has a lower f than successor, skip this successor
                for (Node c : closed) {
                    if (s.equals(c)) {
                        if (s.g >= c.g) {
                            add = false;
                        } else {
                            closed.remove(c);
                        }
                        break;
                    }
                }
            }
            //otherwise, add the node to the open list
            if (add) {
                open.add(s);
            }
        }
        //end
        //push q on the closed list
        closed.add(q);
    }
    //end
    return null;
}

[Buggy Hunk]
if (endx > width || endy > height || endx < 0 || endy < 0) {return null;}

[Patch]
if (endx >= width || endy >= height || endx < 0 || endy < 0) {return null;}

[Demonstration 2]

[Buggy Method]
private String genElsePreCondition(LinkedList<String> array) {
    StringBuilder sb = new StringBuilder();
    sb.append("requires ");
    for (String s : array) {
        sb.append("!(" + s + ")");
        if (array.getLast().equals(s)) {
            sb.append(" && ");
        }
    }
    sb.append("\n");
    return sb.toString();
}

[Buggy Hunk]
if(array.getLast().equals(s)){

[Patch]
if(!array.getLast().equals(s)){

[Demonstration 3]

[Buggy Method]
@Override
public TransactionReceiptDTOExt ethj_getTransactionReceipt(String transactionHash) throws Exception {
    TransactionReceiptDTOExt s = null;
    try {
        byte[] hash = TypeConverter.StringHexToByteArray(transactionHash);
        TransactionReceipt pendingReceipt = pendingReceipts.get(new ByteArrayWrapper(hash));
        TransactionInfo txInfo;
        Block block;
        if (pendingReceipt != null) {
            txInfo = new TransactionInfo(pendingReceipt);
            block = null;
        } else {
            txInfo = blockchain.getTransactionInfo(hash);
            if (txInfo == null)
                return null;
            block = blockchain.getBlockByHash(txInfo.getBlockHash());
            // need to return txes only from main chain
            Block mainBlock = blockchain.getBlockByNumber(block.getNumber());
            if (!Arrays.equals(block.getHash(), mainBlock.getHash())) {
                return null;
            }
        }
        return s = new TransactionReceiptDTOExt(block, txInfo);
    } finally {
        if (logger.isDebugEnabled())
            logger.debug("eth_getTransactionReceipt(" + transactionHash + "): " + s);
    }
}

[Buggy Hunk]
if (logger.isDebugEnabled()) logger.debug("eth_getTransactionReceipt(" + transactionHash + "): " + s);

[Patch]
if (log.isDebugEnabled()) log.debug("eth_getTransactionReceipt(" + transactionHash + "): " + s);