[Demonstration 1]

[Buggy Method]
@Override
public void open(Configuration c) throws IOException {
    super.open(c);
    pendingOperations = getRuntimeContext().getOperatorState("pendingOps", new TreeMap<Long, KVOperation<K, V>>(), false);
}

[Buggy Hunk]
new TreeMap<Long, KVOperation<K, V>>(), false);

[Patch]
new TreeMap<Long, List<KVOperation<K, V>>>(), false);

[Demonstration 2]

[Buggy Method]
public void connect() throws MessagingException, ConfigurationFileException {
    if (!configured)
        throw configurationError;
    try {
        if (account.getReceiveProtocol() == ReceiveProtocol.POP3)
            store = session.getStore("pop3s");
        else
            store = session.getStore("imaps");
    } catch (NoSuchProviderException e) {
        throw new MessagingException("Error when getting the store!", e);
    }
    store.connect(account.getUsername(), account.getPassword());
}

[Buggy Hunk]
store.connect(account.getUsername(), account.getPassword());

[Patch]
store.connect(account.getReceiveServer(), account.getUsername(), account.getPassword());

[Demonstration 3]

[Buggy Method]
@Override
public void start() {
    if (started.compareAndSet(false, true)) {
        throw new IllegalStateException("Http client has already been started!");
    }
    executeOnCallingThread = confMap.get(ConfKeys.EXECUTE_ON_CALLING_THREAD);
    if (Epoll.isAvailable() && confMap.get(ConfKeys.USE_EPOLL)) {
        group = new EpollEventLoopGroup(nioThreads, nioThreadFactory);
    } else {
        group = new NioEventLoopGroup(nioThreads, nioThreadFactory);
    }
    HttpClientResponseHandler responseHandler = new HttpClientResponseHandler(new HttpRedirector());
    HttpClientRequestHandler requestHandler = new HttpClientRequestHandler();
    HttpClientHandler clientHandler = new HttpClientHandler(responseHandler, requestHandler);
    channelManager = new ChannelManager(group, clientHandler, cleanupTimer, timeProvider, channelPool, confMap, rootEventBus);
}

[Buggy Hunk]
if (started.compareAndSet(false, true)) {

[Patch]
if (!started.compareAndSet(false, true)) {