Program: 34852
Project: 34852
Buggy source:
public VirtualConnection read(long numBytes,WsByteBuffer[] req){
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + myID + "String_Node_Str"+ req+ "String_Node_Str"+ numBytes);
  }
  long streamCount=0;
  long requestCount=0;
  if (numBytes > streamReadSize) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + myID + "String_Node_Str"+ numBytes+ "String_Node_Str"+ streamReadSize);
    }
    return null;
  }
  streamCount=streamReadSize;
  requestCount=bytesRemaining(req);
  if (streamCount < requestCount) {
    actualReadCount=streamCount;
  }
 else {
    actualReadCount=requestCount;
  }
  int streamArrayIndex=0;
  int reqArrayIndex=0;
  for (int i=0; i < actualReadCount; i++) {
    if (!req[reqArrayIndex].hasRemaining()) {
      reqArrayIndex++;
      while (true) {
        if (req[reqArrayIndex].hasRemaining()) {
          break;
        }
 else {
          reqArrayIndex++;
        }
      }
    }
    if (!streamReadReady[streamArrayIndex].hasRemaining()) {
      streamReadReady[streamArrayIndex].release();
      streamArrayIndex++;
      while (true) {
        if (streamReadReady[streamArrayIndex].hasRemaining()) {
          break;
        }
 else {
          streamArrayIndex++;
        }
      }
    }
    req[reqArrayIndex].put(streamReadReady[streamArrayIndex].get());
  }
  int streamOldBufferIndex=streamReadBufferIndex;
  streamReadBufferIndex=0;
  streamReadSize=0;
  if (streamReadReady[streamArrayIndex].hasRemaining()) {
    moveDataIntoReadBufferArray(streamReadReady[streamArrayIndex].slice());
  }
  streamArrayIndex++;
  while (streamArrayIndex <= streamOldBufferIndex) {
    moveDataIntoReadBufferArray(streamReadReady[streamArrayIndex]);
    streamArrayIndex++;
  }
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + myID);
  }
  return h2HttpInboundLinkWrap.getVirtualConnection();
}

Fixed version (ground truth):
/** 
 * Read the HTTP header and data bytes for this stream
 * @param numBytes the number of bytes to read
 * @param requestBuffers an array of buffers to copy the read data into
 * @return this stream's VirtualConnection or null if too many bytes were requested
 */
@SuppressWarnings("String_Node_Str") public VirtualConnection read(long numBytes,WsByteBuffer[] requestBuffers){
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + myID + "String_Node_Str"+ requestBuffers+ "String_Node_Str"+ numBytes);
  }
  long streamByteCount=streamReadSize;
  long requestByteCount=bytesRemaining(requestBuffers);
  int reqArrayIndex=0;
  if (numBytes > streamReadSize) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + myID + "String_Node_Str"+ numBytes+ "String_Node_Str"+ streamReadSize);
    }
    return null;
  }
  if (streamByteCount < requestByteCount) {
    actualReadCount=streamByteCount;
  }
 else {
    actualReadCount=requestByteCount;
  }
  for (int bytesRead=0; bytesRead < actualReadCount; bytesRead++) {
    while ((requestBuffers[reqArrayIndex].position() == requestBuffers[reqArrayIndex].limit())) {
      reqArrayIndex++;
    }
    while (!streamReadReady.isEmpty() && !streamReadReady.get(0).hasRemaining()) {
      streamReadReady.get(0).release();
      streamReadReady.remove(0);
    }
    requestBuffers[reqArrayIndex].put(streamReadReady.get(0).get());
  }
  streamReadSize=0;
  readLatch=new CountDownLatch(1);
  for (  WsByteBuffer buffer : ((ArrayList<WsByteBuffer>)streamReadReady.clone())) {
    streamReadReady.clear();
    if (buffer.hasRemaining()) {
      moveDataIntoReadBufferArray(buffer.slice());
    }
  }
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + streamId());
  }
  return h2HttpInboundLinkWrap.getVirtualConnection();
}