[Demonstration 1]

[Buggy Method]
private void setRevision(T item, long rev) {
    if (revisionField != null) {
        try {
            revisionField.set(item, rev);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}

[Buggy Hunk]
if (revisionField != null) {

[Patch]
if (item != null && revisionField != null) {

[Demonstration 2]

[Buggy Method]
private synchronized void sendPosition() {
    Log.d(TAG, "prepare sendPosition()");
    // Pruefung, ob eine aktive Verbindung besteht
    if (mBtService.getState() != BluetoothService.STATE_CONNECTED) {
        Toast.makeText(this, getString(R.string.not_connected), Toast.LENGTH_SHORT).show();
    } else if (isRunningGame()) {
        // aktuelle Position der Schlange
        // TODO schauen ob die Position immernoch geholt wird
        ArrayList<Point> positions = multiView.getSnake().getPosition();
        //            StringBuffer buffer = new StringBuffer();
        // Positionen als bytes initialisieren
        byte[] bytePositions = null;
        // index der bytelaenge, wird dem dude mitgeschickt
        int byteLength = positions.size() * 2;
        // Streams zum konvertieren
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        DataOutputStream dOut = new DataOutputStream(baos);
        // Positionen als bytes schreiben
        try {
            // zuerst den index damit man weiss wie viel bytes relevant sind
            dOut.writeByte(byteLength);
            // dann Positionen umschreiben
            for (Point point : positions) {
                dOut.writeByte(point.x);
                dOut.writeByte(point.y);
            }
        } catch (IOException e) {
            Log.e(TAG, "could not convert positions to bytes", e);
        }
        // aus dem Stream in das byte[] uebergeben
        bytePositions = baos.toByteArray();
        // TODO string variante die Position zu verschicken..
        //            for (Point point : position) {
        //                buffer.append(String.valueOf(point.x));
        //                buffer.append(",");
        //                buffer.append(String.valueOf(point.y));
        //                buffer.append(";");
        //            }
        //            String tmp = buffer.toString();
        //            bytePosition = tmp.getBytes();
        // an den dude senden
        Log.d(TAG, "sending positions");
        mBtService.write(bytePositions);
        //            buffer.setLength(0);
    }
}

[Buggy Hunk]
private synchronized void sendPosition() {

[Patch]
public synchronized void sendPosition() {

[Demonstration 3]

[Buggy Method]
@Override
public void remove(Channel channel) {
    synchronized (channels) {
        for (final Iterator chanIter = channels.iterator(); chanIter.hasNext(); ) {
            if (chanIter.next() == channel) {
                chanIter.remove();
                break;
            }
        }
    }
}

[Buggy Hunk]
for (final Iterator chanIter = channels.iterator(); chanIter.hasNext(); ) {

[Patch]
for (final Iterator chanIter = channels.values().iterator(); chanIter.hasNext(); ) {