Program: 72317
Project: 72317
Buggy source:
@Override protected void channelRead0(ChannelHandlerContext ctx,BasePackage msg){
switch (msg.getMsgType()) {
case BasePackage.HEART_BEAT:
    serverSession.setLastHeartbeatTime(new Date());
  break;
case BasePackage.INITIAL_RESPONSE:
serverSession.updateContextSettings((InitialResponsePackage)msg);
break;
case BasePackage.INVALID_SESSION:
String oneNetName=msg.getContextName();
Long sessionId=msg.getSessionId();
if (StringUtils.isNotEmpty(oneNetName) && sessionId != null) {
OneNetClientContext context=serverSession.getOneNetClientContextMap().get(oneNetName);
context.close(sessionId);
}
break;
case BasePackage.DATA:
if (StringUtils.isNotEmpty(msg.getContextName()) && msg.getSessionId() != null) {
OneNetClientContext context=serverSession.getOneNetClientContextMap().get(msg.getContextName());
if (context == null) {
ctx.channel().writeAndFlush(new InvalidSessionPackage(msg.getContextName(),msg.getSessionId()));
return;
}
ClientSession clientSession=context.getSessionMap().get(msg.getSessionId());
if (clientSession != null) {
clientSession.getLocalChannel().writeAndFlush(((DataPackage)msg).getRawData());
}
 else {
CompletableFuture.runAsync(() -> {
ClientSession newSession=context.getCurrentSession(serverSession,msg.getSessionId());
if (newSession == null) {
log.info("String_Node_Str");
ctx.channel().writeAndFlush(new InvalidSessionPackage(msg.getContextName(),msg.getSessionId()));
}
 else {
newSession.getLocalChannel().writeAndFlush(((DataPackage)msg).getRawData());
}
}
,executor);
}
}
break;
default :
throw new RuntimeException("String_Node_Str");
}
}

Fixed version (ground truth):
@Override protected void channelRead0(ChannelHandlerContext ctx,BasePackage msg){
switch (msg.getMsgType()) {
case BasePackage.HEART_BEAT:
    serverSession.setLastHeartbeatTime(new Date());
  break;
case BasePackage.INITIAL_RESPONSE:
serverSession.updateContextSettings((InitialResponsePackage)msg);
break;
case BasePackage.INVALID_SESSION:
String oneNetName=msg.getContextName();
Long sessionId=msg.getSessionId();
if (StringUtils.isNotEmpty(oneNetName) && sessionId != null) {
OneNetClientContext context=serverSession.getOneNetClientContextMap().get(oneNetName);
context.close(sessionId);
}
break;
case BasePackage.DATA:
if (StringUtils.isNotEmpty(msg.getContextName()) && msg.getSessionId() != null) {
OneNetClientContext context=serverSession.getOneNetClientContextMap().get(msg.getContextName());
if (context == null) {
ctx.channel().writeAndFlush(new InvalidSessionPackage(msg.getContextName(),msg.getSessionId()));
return;
}
ClientSession clientSession=context.getSessionMap().get(msg.getSessionId());
if (clientSession != null) {
clientSession.getLocalChannel().writeAndFlush(((DataPackage)msg).getRawData());
}
 else {
CompletableFuture.runAsync(() -> {
ClientSession newSession=context.getCurrentSession(serverSession,msg.getSessionId());
if (newSession == null) {
log.info("String_Node_Str");
ctx.channel().writeAndFlush(new InvalidSessionPackage(msg.getContextName(),msg.getSessionId()));
}
 else {
newSession.getLocalChannel().writeAndFlush(((DataPackage)msg).getRawData());
}
}
);
}
}
break;
default :
throw new RuntimeException("String_Node_Str");
}
}