Program: 34794
Project: 34794
Buggy source:
private void handleH2LinkPreload(HeaderField header,HttpInboundLink link){
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.entry(tc,"String_Node_Str");
  }
  int streamId=((H2HttpInboundLinkWrap)link).getStreamId();
  String uri=header.asString().substring(header.asString().indexOf('<') + 1,header.asString().indexOf('>'));
  H2HeaderTable h2WriteTable=((H2HttpInboundLinkWrap)link).muxLink.getWriteTable();
  ByteArrayOutputStream ppHb=new ByteArrayOutputStream();
  ByteArrayOutputStream hdrsHb=new ByteArrayOutputStream();
  try {
    ppHb.write(H2Headers.encodeHeader(h2WriteTable,HpackConstants.METHOD,"String_Node_Str",LiteralIndexType.NOINDEXING));
    ppHb.write(H2Headers.encodeHeader(h2WriteTable,HpackConstants.AUTHORITY,getLocalAddr().getHostName(),LiteralIndexType.NOINDEXING));
    ppHb.write(H2Headers.encodeHeader(h2WriteTable,HpackConstants.SCHEME,"String_Node_Str",LiteralIndexType.NOINDEXING));
    ppHb.write(H2Headers.encodeHeader(h2WriteTable,HpackConstants.PATH,uri,LiteralIndexType.NOINDEXING));
    hdrsHb.write(H2Headers.encodeHeader(h2WriteTable,HpackConstants.METHOD,"String_Node_Str",LiteralIndexType.NOINDEXING));
    hdrsHb.write(H2Headers.encodeHeader(h2WriteTable,HpackConstants.AUTHORITY,getLocalAddr().getHostName(),LiteralIndexType.NOINDEXING));
    hdrsHb.write(H2Headers.encodeHeader(h2WriteTable,HpackConstants.SCHEME,"String_Node_Str",LiteralIndexType.NOINDEXING));
    hdrsHb.write(H2Headers.encodeHeader(h2WriteTable,HpackConstants.PATH,uri,LiteralIndexType.NOINDEXING));
  }
 catch (  Exception e) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + e);
    }
    return;
  }
  int promisedStreamId=((H2HttpInboundLinkWrap)link).muxLink.getNextPromisedStreamId();
  FramePushPromise pushPromiseFrame=new FramePushPromise(streamId,ppHb.toByteArray(),promisedStreamId,0,true,false,false);
  FrameHeaders headersFrame=new FrameHeaders(streamId,hdrsHb.toByteArray());
  H2StreamProcessor promisedSP=((H2HttpInboundLinkWrap)link).muxLink.createNewInboundLink(promisedStreamId);
  ((H2HttpInboundLinkWrap)link).setPushPromise(true);
  promisedSP.initializePromisedStream();
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + promisedStreamId);
  }
  H2StreamProcessor existingSP=((H2HttpInboundLinkWrap)link).muxLink.getStreamProcessor(streamId);
  if (existingSP != null) {
    try {
      existingSP.processNextFrame(pushPromiseFrame,com.ibm.ws.http.channel.h2internal.Constants.Direction.WRITING_OUT);
    }
 catch (    ProtocolException e) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
        Tr.debug(tc,"String_Node_Str");
      }
      return;
    }
  }
 else {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + streamId + "String_Node_Str");
    }
    return;
  }
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + streamId);
  }
  promisedSP.sendRequestToWc(headersFrame);
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.exit(tc,"String_Node_Str");
  }
}

Fixed version (ground truth):
private void handleH2LinkPreload(HeaderField header,HttpInboundLink link){
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.entry(tc,"String_Node_Str");
  }
  int streamId=((H2HttpInboundLinkWrap)link).getStreamId();
  String uri=header.asString().substring(header.asString().indexOf('<') + 1,header.asString().indexOf('>'));
  H2HeaderTable h2WriteTable=((H2HttpInboundLinkWrap)link).muxLink.getWriteTable();
  ByteArrayOutputStream ppHb=new ByteArrayOutputStream();
  ByteArrayOutputStream hdrsHb=new ByteArrayOutputStream();
  try {
    ppHb.write(H2Headers.encodeHeader(h2WriteTable,HpackConstants.METHOD,"String_Node_Str",LiteralIndexType.NOINDEXING));
    String authority=getLocalAddr().getHostName() + "String_Node_Str" + getLocalPort();
    ppHb.write(H2Headers.encodeHeader(h2WriteTable,HpackConstants.AUTHORITY,authority,LiteralIndexType.NOINDEXING));
    if (this.isSecure()) {
      ppHb.write(H2Headers.encodeHeader(h2WriteTable,HpackConstants.SCHEME,"String_Node_Str",LiteralIndexType.NOINDEXING));
    }
 else {
      ppHb.write(H2Headers.encodeHeader(h2WriteTable,HpackConstants.SCHEME,"String_Node_Str",LiteralIndexType.NOINDEXING));
    }
    ppHb.write(H2Headers.encodeHeader(h2WriteTable,HpackConstants.PATH,uri,LiteralIndexType.NOINDEXING));
    hdrsHb.write(H2Headers.encodeHeader(h2WriteTable,HpackConstants.METHOD,"String_Node_Str",LiteralIndexType.NOINDEXING));
    hdrsHb.write(H2Headers.encodeHeader(h2WriteTable,HpackConstants.AUTHORITY,getLocalAddr().getHostName(),LiteralIndexType.NOINDEXING));
    if (this.isSecure()) {
      hdrsHb.write(H2Headers.encodeHeader(h2WriteTable,HpackConstants.SCHEME,"String_Node_Str",LiteralIndexType.NOINDEXING));
    }
 else {
      hdrsHb.write(H2Headers.encodeHeader(h2WriteTable,HpackConstants.SCHEME,"String_Node_Str",LiteralIndexType.NOINDEXING));
    }
    hdrsHb.write(H2Headers.encodeHeader(h2WriteTable,HpackConstants.PATH,uri,LiteralIndexType.NOINDEXING));
  }
 catch (  Exception e) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + e);
    }
    return;
  }
  int promisedStreamId=((H2HttpInboundLinkWrap)link).muxLink.getNextPromisedStreamId();
  FramePushPromise pushPromiseFrame=new FramePushPromise(streamId,ppHb.toByteArray(),promisedStreamId,0,true,false,false);
  FrameHeaders headersFrame=new FrameHeaders(streamId,hdrsHb.toByteArray());
  H2StreamProcessor promisedSP=((H2HttpInboundLinkWrap)link).muxLink.createNewInboundLink(promisedStreamId);
  if (promisedSP == null) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + "String_Node_Str" + link);
    }
    return;
  }
  ((H2HttpInboundLinkWrap)link).setPushPromise(true);
  promisedSP.initializePromisedStream();
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + promisedStreamId);
  }
  H2StreamProcessor existingSP=((H2HttpInboundLinkWrap)link).muxLink.getStreamProcessor(streamId);
  if (existingSP != null) {
    try {
      existingSP.processNextFrame(pushPromiseFrame,com.ibm.ws.http.channel.h2internal.Constants.Direction.WRITING_OUT);
    }
 catch (    ProtocolException e) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
        Tr.debug(tc,"String_Node_Str");
      }
      return;
    }
  }
 else {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + streamId + "String_Node_Str");
    }
    return;
  }
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + streamId);
  }
  promisedSP.sendRequestToWc(headersFrame);
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.exit(tc,"String_Node_Str");
  }
}