[Demonstration 1]

[Buggy Method]
protected final Packet sendPacket(final T session, @Nullable final String etag, @Nonnull final ChangeSet changeSet) {
    final String requestID = (String) getRegistry().getResource(ReplicantContext.REQUEST_ID_KEY);
    ReplicantContextHolder.put(ReplicantContext.REQUEST_COMPLETE_KEY, "0");
    return session.getQueue().addPacket(requestID, etag, changeSet);
}

[Buggy Hunk]
ReplicantContextHolder.put( ReplicantContext.REQUEST_COMPLETE_KEY, "0" );

[Patch]
getRegistry().putResource( ReplicantContext.REQUEST_COMPLETE_KEY, Boolean.FALSE );

[Demonstration 2]

[Buggy Method]
public int writeVirtualMemory(int vaddr, byte[] data, int offset, int length) {
    Lib.assertTrue(offset >= 0 && length >= 0 && offset + length <= data.length);
    byte[] memory = Machine.processor().getMemory();
    int vpn = Processor.pageFromAddress(vaddr);
    int ppn = getPPN(vpn, true);
    if (ppn < 0)
        return 0;
    int pageOffset = Processor.offsetFromAddress(vaddr);
    int paddr = Processor.makeAddress(ppn, pageOffset);
    int res = Math.min(length, pageSize - pageOffset);
    System.arraycopy(data, offset, memory, vaddr, res);
    while (length > res) {
        vpn++;
        ppn = getPPN(vpn, true);
        if (ppn < 0)
            return res;
        paddr = Processor.makeAddress(ppn, 0);
        int amount = Math.min(length - res, pageSize);
        System.arraycopy(data, offset + res, memory, paddr, amount);
        res += amount;
    }
    return res;
}

[Buggy Hunk]
System.arraycopy(data, offset, memory, vaddr, res);

[Patch]
System.arraycopy(data, offset, memory, paddr, res);

[Demonstration 3]

[Buggy Method]
@Override
public int indexSound() {
    return this.kernel.updateSoundDescriptors(1);
}

[Buggy Hunk]
return this.kernel.updateSoundDescriptors(1);

[Patch]
return this.kernel.updateSoundDescriptors(0);