Program: 96447
Project: 96447
Buggy source:
@Override protected void doMessageReceived(final IoSessionEx session,Object message) throws Exception {
  DefaultHttpSession httpSession=HTTP_SESSION_KEY.get(session);
  HttpMessage httpMessage=(HttpMessage)message;
switch (httpMessage.getKind()) {
case RESPONSE:
    HttpResponseMessage httpResponse=(HttpResponseMessage)httpMessage;
  HttpStatus httpStatus=httpResponse.getStatus();
httpSession.setStatus(httpStatus);
httpSession.setReason(httpResponse.getReason());
httpSession.setVersion(httpResponse.getVersion());
httpSession.setReadHeaders(httpResponse.getHeaders());
httpSession.getResponseFuture().setReady();
switch (httpStatus) {
case INFO_SWITCHING_PROTOCOLS:
httpSession.close(false);
break;
case SUCCESS_OK:
switch (httpSession.getMethod()) {
case HEAD:
httpSession.close(false);
break;
default :
HttpContentMessage httpContent=httpResponse.getContent();
if (httpContent == null) {
IoBufferAllocatorEx<? extends HttpBuffer> allocator=httpSession.getBufferAllocator();
httpContent=new HttpContentMessage(allocator.wrap(allocator.allocate(0)),true);
}
fireContentReceived(httpSession,httpContent);
}
break;
case REDIRECT_MOVED_PERMANENTLY:
case REDIRECT_FOUND:
if (shouldFollowRedirects(httpSession)) {
if (httpResponse.isComplete()) {
followRedirect(httpSession,session);
}
break;
}
case SUCCESS_NO_CONTENT:
case REDIRECT_NOT_MODIFIED:
httpSession.close(false);
break;
case CLIENT_UNAUTHORIZED:
String authenticate=getAuthentication(httpSession,(HttpResponseMessage)httpMessage,SERVER);
if (authenticate != null) {
authenticate(httpSession,session,authenticate,SERVER);
}
 else {
HttpContentMessage httpContent=httpResponse.getContent();
if (httpContent == null) {
IoBufferAllocatorEx<? extends HttpBuffer> allocator=httpSession.getBufferAllocator();
httpContent=new HttpContentMessage(allocator.wrap(allocator.allocate(0)),true);
}
fireContentReceived(httpSession,httpContent);
}
break;
default :
HttpContentMessage httpContent=httpResponse.getContent();
if (httpContent == null) {
IoBufferAllocatorEx<? extends HttpBuffer> allocator=httpSession.getBufferAllocator();
httpContent=new HttpContentMessage(allocator.wrap(allocator.allocate(0)),true);
}
fireContentReceived(httpSession,httpContent);
break;
}
break;
case CONTENT:
HttpContentMessage httpContent=(HttpContentMessage)httpMessage;
switch (httpSession.getStatus()) {
case REDIRECT_MOVED_PERMANENTLY:
case REDIRECT_FOUND:
if (shouldFollowRedirects(httpSession) && httpContent.isComplete()) {
followRedirect(httpSession,session);
}
break;
default :
fireContentReceived(httpSession,httpContent);
break;
}
break;
default :
throw new IllegalArgumentException("String_Node_Str" + httpMessage.getKind());
}
}

Fixed version (ground truth):
@Override protected void doMessageReceived(final IoSessionEx session,Object message) throws Exception {
  DefaultHttpSession httpSession=HTTP_SESSION_KEY.get(session);
  HttpMessage httpMessage=(HttpMessage)message;
switch (httpMessage.getKind()) {
case RESPONSE:
    HttpResponseMessage httpResponse=(HttpResponseMessage)httpMessage;
  HttpStatus httpStatus=httpResponse.getStatus();
httpSession.setStatus(httpStatus);
httpSession.setReason(httpResponse.getReason());
httpSession.setVersion(httpResponse.getVersion());
httpSession.setReadHeaders(httpResponse.getHeaders());
httpSession.getResponseFuture().setReady();
switch (httpStatus) {
case INFO_SWITCHING_PROTOCOLS:
httpSession.close(false);
break;
case SUCCESS_OK:
switch (httpSession.getMethod()) {
case HEAD:
httpSession.close(false);
break;
default :
HttpContentMessage httpContent=httpResponse.getContent();
if (httpContent == null) {
IoBufferAllocatorEx<? extends HttpBuffer> allocator=httpSession.getBufferAllocator();
httpContent=new HttpContentMessage(allocator.wrap(allocator.allocate(0)),true);
}
fireContentReceived(httpSession,httpContent);
}
break;
case REDIRECT_MOVED_PERMANENTLY:
case REDIRECT_FOUND:
case REDIRECT_MULTIPLE_CHOICES:
case REDIRECT_SEE_OTHER:
case REDIRECT_NOT_MODIFIED:
case REDIRECT_USE_PROXY:
case REDIRECT_TEMPORARY:
doRedirectReceived(session,httpSession,httpResponse);
break;
case SUCCESS_NO_CONTENT:
httpSession.close(false);
break;
case CLIENT_UNAUTHORIZED:
String authenticate=getAuthentication(httpSession,(HttpResponseMessage)httpMessage,SERVER);
if (authenticate != null) {
authenticate(httpSession,session,authenticate,SERVER);
}
 else {
HttpContentMessage httpContent=httpResponse.getContent();
if (httpContent == null) {
IoBufferAllocatorEx<? extends HttpBuffer> allocator=httpSession.getBufferAllocator();
httpContent=new HttpContentMessage(allocator.wrap(allocator.allocate(0)),true);
}
fireContentReceived(httpSession,httpContent);
}
break;
default :
HttpContentMessage httpContent=httpResponse.getContent();
if (httpContent == null) {
IoBufferAllocatorEx<? extends HttpBuffer> allocator=httpSession.getBufferAllocator();
httpContent=new HttpContentMessage(allocator.wrap(allocator.allocate(0)),true);
}
fireContentReceived(httpSession,httpContent);
break;
}
break;
case CONTENT:
HttpContentMessage httpContent=(HttpContentMessage)httpMessage;
switch (httpSession.getStatus()) {
case REDIRECT_MOVED_PERMANENTLY:
case REDIRECT_FOUND:
case REDIRECT_MULTIPLE_CHOICES:
case REDIRECT_SEE_OTHER:
case REDIRECT_NOT_MODIFIED:
case REDIRECT_USE_PROXY:
case REDIRECT_TEMPORARY:
doRedirectReceived(session,httpSession,httpContent);
break;
default :
fireContentReceived(httpSession,httpContent);
break;
}
break;
default :
throw new IllegalArgumentException("String_Node_Str" + httpMessage.getKind());
}
}