[Demonstration 1]

[Buggy Method]
public void run() {
    int read;
    byte[] buf = new byte[BUFSIZE];
    int offset = 0;
    try {
        do {
            read = inputStream.read(buf, offset, buf.length - offset);
            lastReadTime = System.currentTimeMillis();
            if (read > 0) {
                int splitByte = findMessageBreak(buf, offset, read);
                if (splitByte >= 0) {
                    String msg = new String(buf, 0, splitByte, java.nio.charset.Charset.forName("UTF-8"));
                    collect(msg);
                    int startOfNextMessage = splitByte + 4;
                    int totalRead = offset + read;
                    if (startOfNextMessage < totalRead)
                        inputStream.unread(buf, startOfNextMessage, totalRead - startOfNextMessage);
                    offset = 0;
                } else {
                    offset += read;
                    if (offset > buf.length * 0.8) {
                        byte[] newbuff = new byte[buf.length * 2];
                        System.arraycopy(buf, 0, newbuff, 0, offset);
                        buf = newbuff;
                    }
                }
            }
        } while (read >= 0 && !stop);
    } catch (IOException e) {
        System.out.println(e.getMessage());
        e.printStackTrace();
    } finally {
        try {
            inputStream.close();
            socket.close();
        } catch (IOException e) {
            throw new Error(e);
        }
    }
}

[Buggy Hunk]
System.out.println(e.getMessage());

[Patch]
System.out.println("method(run)" + e.getMessage());

[Demonstration 2]

[Buggy Method]
@Override
public boolean isFullGdbConsoleSupported() {
    return !Platform.getOS().equals(Platform.OS_WIN32) && !fPtyFailure;
}

[Buggy Hunk]
return !Platform.getOS().equals(Platform.OS_WIN32)

[Patch]
return !Platform.getOS().equals(Platform.OS_WIN32) && !Platform.getOS().equals(Platform.OS_MACOSX)

[Demonstration 3]

[Buggy Method]
PublicationId getPublicationId(PublicationId groupId, String publicationName) throws RemoteException, DLibraException {
    Collection<Info> resultInfos = publicationManager.getObjects(new PublicationFilter(null, groupId).setGroupStatus(Publication.PUB_GROUP_LEAF).setPublicationState((byte) (Publication.PUB_STATE_ALL - Publication.PUB_STATE_PERMANENT_DELETED)), new OutputFilter(AbstractPublicationInfo.class)).getResultInfos();
    for (Info info : resultInfos) {
        if (info.getLabel().equals(publicationName)) {
            return (PublicationId) info.getId();
        }
    }
    throw new IdNotFoundException(publicationName);
}

[Buggy Hunk]
.setGroupStatus(Publication.PUB_GROUP_LEAF)

[Patch]
.setGroupStatus(Publication.PUB_GROUP_ALL)