Program: 34776
Project: 34776
Buggy source:
/** 
 * Before marshalling headers into a buffer, this will run the data through a compliancy check and take appropriate action (throw errors, add missing headers, etc).
 * @throws MessageSentException
 */
@Override protected void headerComplianceCheck() throws MessageSentException {
  final HttpServiceContextImpl sc=getServiceContext();
  if (sc.headersSent()) {
    throw new MessageSentException("String_Node_Str");
  }
  try {
    if (getVersionValue().equals(VersionValues.V11)) {
      if (NOTSET == getContentLength() && !isChunkedEncodingSet()) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
          Tr.debug(tc,"String_Node_Str");
        }
        if (sc.isOutgoingBodyValid()) {
          addTransferEncoding(TransferEncodingValues.CHUNKED);
          commitTransferEncoding();
        }
      }
      if (!sc.isPersistent() && !isCloseSet()) {
        setupConnectionClose();
      }
    }
 else     if (getVersionValue().equals(VersionValues.V10)) {
      if (isChunkedEncodingSet()) {
        removeSpecialHeader(HttpHeaderKeys.HDR_TRANSFER_ENCODING);
        removeLocalTransferEncoding();
        sc.setPersistent(false);
      }
      if (!sc.isPersistent() || NOTSET == getContentLength()) {
        if (!isCloseSet()) {
          setupConnectionClose();
        }
        sc.setPersistent(false);
      }
 else       if (sc.isPersistent()) {
        if (!isKeepAliveSet() && !isCloseSet()) {
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc,"String_Node_Str");
          }
          addConnection(ConnectionValues.KEEPALIVE);
          commitConnection();
        }
      }
    }
 else     if (getVersionValue().equals(VersionValues.V20)) {
      if (getContentLength() != HeaderStorage.NOTSET) {
        setContentLength(HeaderStorage.NOTSET);
      }
      if (isChunkedEncodingSet()) {
        removeTransferEncoding(TransferEncodingValues.CHUNKED);
      }
    }
    removeSpecialHeader(HttpHeaderKeys.HDR_$WSZIP);
    removeSpecialHeader(HttpHeaderKeys.HDR_$WSORIGCL);
  }
 catch (  IllegalArgumentException iae) {
    FFDCFilter.processException(iae,getClass().getName() + "String_Node_Str","String_Node_Str",this);
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str");
    }
  }
 finally {
    if (sc.getHttpConfig().isServantRegion()) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
        Tr.debug(tc,"String_Node_Str" + sc.isPersistent());
      }
      sc.getVC().getStateMap().put(HttpConstants.SESSION_PERSISTENCE,(sc.isPersistent()) ? "String_Node_Str" : "String_Node_Str");
      sc.setPersistent(false);
    }
  }
}

Fixed version (ground truth):
/** 
 * Before marshalling headers into a buffer, this will run the data through a compliancy check and take appropriate action (throw errors, add missing headers, etc).
 * @throws MessageSentException
 */
@Override protected void headerComplianceCheck() throws MessageSentException {
  final HttpServiceContextImpl sc=getServiceContext();
  if (sc.headersSent()) {
    throw new MessageSentException("String_Node_Str");
  }
  try {
    if (getVersionValue().equals(VersionValues.V11)) {
      if (NOTSET == getContentLength() && !isChunkedEncodingSet()) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
          Tr.debug(tc,"String_Node_Str");
        }
        if (sc.isOutgoingBodyValid()) {
          addTransferEncoding(TransferEncodingValues.CHUNKED);
          commitTransferEncoding();
        }
      }
      if (!sc.isPersistent() && !isCloseSet()) {
        setupConnectionClose();
      }
    }
 else     if (getVersionValue().equals(VersionValues.V10)) {
      if (isChunkedEncodingSet()) {
        removeSpecialHeader(HttpHeaderKeys.HDR_TRANSFER_ENCODING);
        removeLocalTransferEncoding();
        sc.setPersistent(false);
      }
      if (!sc.isPersistent() || NOTSET == getContentLength()) {
        if (!isCloseSet()) {
          setupConnectionClose();
        }
        sc.setPersistent(false);
      }
 else       if (sc.isPersistent()) {
        if (!isKeepAliveSet() && !isCloseSet()) {
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc,"String_Node_Str");
          }
          addConnection(ConnectionValues.KEEPALIVE);
          commitConnection();
        }
      }
    }
 else     if (getVersionValue().equals(VersionValues.V20)) {
      if (isChunkedEncodingSet()) {
        removeTransferEncoding(TransferEncodingValues.CHUNKED);
      }
    }
    removeSpecialHeader(HttpHeaderKeys.HDR_$WSZIP);
    removeSpecialHeader(HttpHeaderKeys.HDR_$WSORIGCL);
  }
 catch (  IllegalArgumentException iae) {
    FFDCFilter.processException(iae,getClass().getName() + "String_Node_Str","String_Node_Str",this);
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str");
    }
  }
 finally {
    if (sc.getHttpConfig().isServantRegion()) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
        Tr.debug(tc,"String_Node_Str" + sc.isPersistent());
      }
      sc.getVC().getStateMap().put(HttpConstants.SESSION_PERSISTENCE,(sc.isPersistent()) ? "String_Node_Str" : "String_Node_Str");
      sc.setPersistent(false);
    }
  }
}