Program: 55256
Project: 55256
Buggy source:
@Override protected void onRead(@NotNull final DocumentContext inDc,@NotNull final WireOut out){
  WireIn in=inDc.wire();
  if (!YamlLogging.showHeartBeats()) {
    prevLogMessage.setLength(0);
    prevLogMessage.append(currentLogMessage);
    currentLogMessage.setLength(0);
    logToBuffer(in,currentLogMessage);
  }
 else {
    logYamlToStandardOut(in);
  }
  if (inDc.isMetaData()) {
    this.metaDataConsumer.readMarshallable(in);
  }
 else {
    try {
      if (LOG.isDebugEnabled())       LOG.debug("String_Node_Str" + in.bytes().toHexString());
      Consumer<WireType> wireTypeConsumer=wt -> {
        wireType(wt);
        checkWires(in.bytes(),out.bytes(),wireType());
      }
;
      if (isSystemMessage) {
        systemHandler.process(in,out,tid,sessionDetails,getMonitoringMap(),isServerSocket,this::publisher,hostIdentifier,wireTypeConsumer,wireType());
        if (!systemHandler.wasHeartBeat()) {
          if (!YamlLogging.showHeartBeats())           logBufferToStandardOut(prevLogMessage.append(currentLogMessage));
        }
        return;
      }
      if (!YamlLogging.showHeartBeats()) {
        logBufferToStandardOut(prevLogMessage.append(currentLogMessage));
      }
      Map<String,UserStat> userMonitoringMap=getMonitoringMap();
      if (userMonitoringMap != null) {
        UserStat userStat=userMonitoringMap.get(sessionDetails.userId());
        if (userStat == null) {
          throw new AssertionError("String_Node_Str");
        }
        userStat.setRecentInteraction(LocalTime.now());
        userStat.setTotalInteractions(userStat.getTotalInteractions() + 1);
        userMonitoringMap.put(sessionDetails.userId(),userStat);
      }
      if (wireAdapter != null) {
        if (viewType == MapView.class) {
          mapWireHandler.process(in,out,(MapView)view,tid,wireAdapter,requestContext);
          return;
        }
        if (viewType == EntrySetView.class) {
          entrySetHandler.process(in,out,(EntrySetView)view,wireAdapter.entryToWire(),wireAdapter.wireToEntry(),HashSet::new,tid);
          return;
        }
        if (viewType == KeySetView.class) {
          keySetHandler.process(in,out,(KeySetView)view,wireAdapter.keyToWire(),wireAdapter.wireToKey(),HashSet::new,tid);
          return;
        }
        if (viewType == ValuesCollection.class) {
          valuesHandler.process(in,out,(ValuesCollection)view,wireAdapter.keyToWire(),wireAdapter.wireToKey(),ArrayList::new,tid);
          return;
        }
        if (viewType == ObjectSubscription.class) {
          subscriptionHandler.process(in,requestContext,publisher(),contextAsset,tid,outWire,(SubscriptionCollection)view);
          return;
        }
        if (viewType == TopologySubscription.class) {
          topologySubscriptionHandler.process(in,requestContext,publisher(),contextAsset,tid,outWire,(TopologySubscription)view);
          return;
        }
        if (viewType == Reference.class) {
          referenceHandler.process(in,requestContext,publisher(),tid,(Reference)view,cspText,outWire,wireAdapter);
          return;
        }
        if (viewType == TopicPublisher.class || viewType == QueueView.class) {
          topicPublisherHandler.process(in,publisher(),tid,outWire,(TopicPublisher)view,wireAdapter);
          return;
        }
        if (viewType == Publisher.class) {
          publisherHandler.process(in,requestContext,publisher(),tid,(Publisher)view,outWire,wireAdapter);
          return;
        }
        if (viewType == Replication.class) {
          replicationHandler.process(in,publisher(),tid,outWire,hostIdentifier,(Replication)view,eventLoop);
        }
      }
    }
 catch (    Exception e) {
      LOG.error("String_Node_Str",e);
    }
 finally {
      if (sessionProvider != null)       sessionProvider.remove();
    }
  }
}

Fixed version (ground truth):
@Override protected void onRead(@NotNull final DocumentContext inDc,@NotNull final WireOut out){
  WireIn in=inDc.wire();
  if (!YamlLogging.showHeartBeats()) {
    prevLogMessage.setLength(0);
    prevLogMessage.append(currentLogMessage);
    currentLogMessage.setLength(0);
    logToBuffer(in,currentLogMessage,in.bytes().readPosition() - 4);
  }
 else {
    logYamlToStandardOut(in);
  }
  if (inDc.isMetaData()) {
    this.metaDataConsumer.readMarshallable(in);
  }
 else {
    try {
      if (LOG.isDebugEnabled())       LOG.debug("String_Node_Str" + in.bytes().toHexString());
      Consumer<WireType> wireTypeConsumer=wt -> {
        wireType(wt);
        checkWires(in.bytes(),out.bytes(),wireType());
      }
;
      if (isSystemMessage) {
        systemHandler.process(in,out,tid,sessionDetails,getMonitoringMap(),isServerSocket,this::publisher,hostIdentifier,wireTypeConsumer,wireType());
        if (!systemHandler.wasHeartBeat()) {
          if (!YamlLogging.showHeartBeats())           logBufferToStandardOut(prevLogMessage.append(currentLogMessage));
        }
        return;
      }
      if (!YamlLogging.showHeartBeats()) {
        logBufferToStandardOut(prevLogMessage.append(currentLogMessage));
      }
      Map<String,UserStat> userMonitoringMap=getMonitoringMap();
      if (userMonitoringMap != null) {
        UserStat userStat=userMonitoringMap.get(sessionDetails.userId());
        if (userStat == null) {
          throw new AssertionError("String_Node_Str");
        }
        userStat.setRecentInteraction(LocalTime.now());
        userStat.setTotalInteractions(userStat.getTotalInteractions() + 1);
        userMonitoringMap.put(sessionDetails.userId(),userStat);
      }
      if (wireAdapter != null) {
        if (viewType == MapView.class) {
          mapWireHandler.process(in,out,(MapView)view,tid,wireAdapter,requestContext);
          return;
        }
        if (viewType == EntrySetView.class) {
          entrySetHandler.process(in,out,(EntrySetView)view,wireAdapter.entryToWire(),wireAdapter.wireToEntry(),HashSet::new,tid);
          return;
        }
        if (viewType == KeySetView.class) {
          keySetHandler.process(in,out,(KeySetView)view,wireAdapter.keyToWire(),wireAdapter.wireToKey(),HashSet::new,tid);
          return;
        }
        if (viewType == ValuesCollection.class) {
          valuesHandler.process(in,out,(ValuesCollection)view,wireAdapter.keyToWire(),wireAdapter.wireToKey(),ArrayList::new,tid);
          return;
        }
        if (viewType == ObjectSubscription.class) {
          subscriptionHandler.process(in,requestContext,publisher(),contextAsset,tid,outWire,(SubscriptionCollection)view);
          return;
        }
        if (viewType == TopologySubscription.class) {
          topologySubscriptionHandler.process(in,requestContext,publisher(),contextAsset,tid,outWire,(TopologySubscription)view);
          return;
        }
        if (viewType == Reference.class) {
          referenceHandler.process(in,requestContext,publisher(),tid,(Reference)view,cspText,outWire,wireAdapter);
          return;
        }
        if (viewType == TopicPublisher.class || viewType == QueueView.class) {
          topicPublisherHandler.process(in,publisher(),tid,outWire,(TopicPublisher)view,wireAdapter);
          return;
        }
        if (viewType == Publisher.class) {
          publisherHandler.process(in,requestContext,publisher(),tid,(Publisher)view,outWire,wireAdapter);
          return;
        }
        if (viewType == Replication.class) {
          replicationHandler.process(in,publisher(),tid,outWire,hostIdentifier,(Replication)view,eventLoop);
        }
      }
    }
 catch (    Exception e) {
      LOG.error("String_Node_Str",e);
    }
 finally {
      if (sessionProvider != null)       sessionProvider.remove();
    }
  }
}