[Demonstration 1]

[Buggy Method]
private <PayloadType> void handle(ProcessingVertex processingVertex, TransitionPayloadContext payloadContext, CompletableFuture<PayloadType> executionResultFuture) {
    CRReactorGraph.ProcessingItemInfo processorInfo = processingVertex.getProcessorInfo();
    Object payload = payloadContext.getPayload();
    /**
     * In case of detached merge point processor should not have incoming handling transition.
     */
    if (processorInfo.getProcessingItemType() == CRReactorGraph.ProcessingItemType.MERGE_POINT) {
        throw new IllegalStateException(String.format("Processor %s is of type %s and should not have any incoming handling transition", processingVertex.getProcessingItem().getDebugName(), processorInfo.getProcessingItemType()));
    }
    ProfiledCall handleCall = profiler.profiledCall(ProfilerNames.PROCESSOR_HANDLE + processingVertex.getProcessingItem().getProfilingName()).start();
    boolean isTraceablePayload = tracer.isTraceable(payload);
    Object handleTracingMarker = isTraceablePayload ? tracer.beforeHandle(processingVertex.getProcessingItem().getIdentity(), payload) : null;
    ReactorGraphModel.Identity handleTracingIdentity = isTraceablePayload ? processingVertex.getProcessingItem().getIdentity() : null;
    CompletableFuture<?> handlingResult;
    /**
     * Immutability check ensures that there is no payload modification during handling.
     */
    final ImmutabilityControlLevel controlLevel = this.immutabilityControlLevel;
    Object payloadClone;
    ImmutabilityChecker.Snapshot payloadCloneSnapshot;
    try {
        if (controlLevel != ImmutabilityControlLevel.NO_CONTROL) {
            /**
             * Invoke handling with immutability check.
             * Do not use origin payload, make two copies of payload.
             */
            payloadClone = immutabilityChecker.clone(payload);
            payloadCloneSnapshot = immutabilityChecker.takeSnapshot(payloadClone);
            handlingResult = invokeHandlingMethod(processorInfo, processingVertex.getProcessingItem(), payloadClone);
        } else {
            /**
             * Invoke handling without immutability check.
             */
            payloadClone = null;
            payloadCloneSnapshot = null;
            handlingResult = invokeHandlingMethod(processorInfo, processingVertex.getProcessingItem(), payload);
        }
    } catch (Exception handlingException) {
        RuntimeException exc = new RuntimeException(String.format("Failed handling by processor %s for payload %s %s. Handling method raised exception: %s.", processingVertex.getProcessingItem().getDebugName(), payload.getClass(), debugSerializer.dumpObject(payload), handlingException), handlingException);
        log.error(exc.getMessage(), exc);
        executionResultFuture.completeExceptionally(exc);
        processingVertex.getProcessorFuture().complete(new HandlePayloadContext().setTerminal(true));
        return;
    }
    if (handlingResult == null) {
        RuntimeException exc = new RuntimeException(String.format("Failed handling by processor %s for payload %s %s. Handling method returned NULL." + " Instance of CompletableFuture expected.", processingVertex.getProcessingItem().getDebugName(), payload.getClass(), debugSerializer.dumpObject(payload)));
        log.error(exc.getMessage(), exc);
        executionResultFuture.completeExceptionally(exc);
        processingVertex.getProcessorFuture().complete(new HandlePayloadContext().setTerminal(true));
        return;
    }
    handlingResult.handleAsync((res, thr) -> {
        handleCall.stop();
        if (isTraceablePayload) {
            tracer.afterHandle(handleTracingMarker, handleTracingIdentity, res, thr);
        }
        if (controlLevel != ImmutabilityControlLevel.NO_CONTROL) {
            Optional<String> diff = immutabilityChecker.diff(payloadCloneSnapshot, payloadClone);
            if (diff.isPresent()) {
                String message = String.format("Concurrent modification of payload %s. Diff: %s.", debugSerializer.dumpObject(payload), diff.get());
                switch(controlLevel) {
                    case LOG_ERROR:
                        log.error(message);
                        break;
                    case LOG_WARN:
                        log.warn(message);
                        break;
                    case EXCEPTION:
                        RuntimeException immutabilityException = new RuntimeException(message);
                        log.error(message, immutabilityException);
                        if (thr == null) {
                            log.error("Overwriting execution exception {} by immutability check exception {}.", thr, immutabilityException, thr);
                        }
                        thr = immutabilityException;
                        break;
                }
            }
        }
        if (thr != null) {
            RuntimeException exc = new RuntimeException(String.format("Failed handling by processor %s for payload %s %s", processingVertex.getProcessingItem().getDebugName(), payload.getClass(), debugSerializer.dumpObject(payload)), thr);
            log.error(exc.getMessage(), exc);
            executionResultFuture.completeExceptionally(exc);
            processingVertex.getProcessorFuture().complete(new HandlePayloadContext().setTerminal(true));
        } else {
            processingVertex.getProcessorFuture().complete(new HandlePayloadContext().setPayload(payload).setProcessorResult(res));
        }
        return null;
    });
}

[Buggy Hunk]
CRReactorGraph.ProcessingItemInfo processorInfo = processingVertex.getProcessorInfo();

[Patch]
CRReactorGraph.ProcessingItemInfo processorInfo = processingVertex.getProcessingItemInfo();

[Demonstration 2]

[Buggy Method]
@Override
public void onEnable() {
    this.loadConfig();
    this.repo = new Repository(this);
    this.regionsManager = Accessor.getRegionManagerInstance();
    this.generator = new BlockGenerator(this, 50000);
    this.modes = new ModeManager(this);
    this.arenaManager = new ArenaManager(this);
    if (this.repo.isEconomyEnabled()) {
        this.eco = new WgEconomy(this);
    }
    startMetrics();
    startUpdater();
    registerCommands();
    this.wgListener = new WgListener(this);
    this.offlineManager = new OfflineManager(this);
    this.scoreboardManager = new ScoreboardManager<PlayerGroupKey>();
    this.scoreboard = new ScoreboardDisplay(this);
    this.inviteManager = new InvitationManager(this);
    if (this.repo.getKit() == null) {
        this.getLogger().warning("Kein Kit Provider gefunden!");
    } else {
        this.getLogger().info(this.repo.getKit().getName() + " stellt die Kits bereit.");
    }
    this.getLogger().info("Plugin erfolgreich geladen!");
}

[Buggy Hunk]
this.regionsManager = Accessor.getRegionManagerInstance();

[Patch]
this.regionsManager = new RegionManager();

[Demonstration 3]

[Buggy Method]
private void initSynthesizer() {
    //init Synthesizer
    m_syn = new Synthesizer();
    //set Synthesizer call back
    m_syn.setReceiveWave(new ITTSCallback() {

        public int ReceiveWave(Object callBackStat, final byte[] data, int size) {
            //write to audio card
            audioTrack.write(data, 0, size);
            return 0;
        }
    });
    //init speech handle
    handle = m_syn.MSTTS_CreateSpeechSynthesizerHandler(handle, getResources().getString(R.string.primaryKey));
    if (handle == -1) {
        talkLable.setText("initialization failed.");
        result = -1;
    }
    //set output
    if (result == 0) {
        result = m_syn.MSTTS_SetOutput(handle, null, m_syn);
    }
}

[Buggy Hunk]
talkLable.setText("initialization failed.");

[Patch]
bankTalkLable.setText("initialization failed.");