nus-yam/ex-repair huggingface dataset:
Program: 34831
Project: 34831
Buggy source:
/** 
 * Setup the SSL engine for the given context.
 * @param context used to build the engine
 * @param type to determine if connection is inbound or outbound
 * @param config SSL channel configuration
 * @return SSLEngine
 */
public static SSLEngine getSSLEngine(SSLContext context,FlowType type,SSLLinkConfig config){
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.entry(tc,"String_Node_Str");
  }
  SSLEngine engine=context.createSSLEngine();
  configureEngine(engine,type,config);
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.exit(tc,"String_Node_Str" + engine.hashCode());
  }
  return engine;
}

Fixed version (ground truth):
/** 
 * Setup the SSL engine for the given context.
 * @param context used to build the engine
 * @param type to determine if connection is inbound or outbound
 * @param config SSL channel configuration
 * @return SSLEngine
 */
public static SSLEngine getSSLEngine(SSLContext context,FlowType type,SSLLinkConfig config){
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.entry(tc,"String_Node_Str");
  }
  SSLEngine engine=context.createSSLEngine();
  grizzlyAlpnNegotiator.tryToUseGrizzlyJdk8Alpn(engine);
  configureEngine(engine,type,config);
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.exit(tc,"String_Node_Str" + engine.hashCode());
  }
  return engine;
}
Program: 34832
Project: 34832
Buggy source:
/** 
 * Create an SSL engine with the input parameters. The host and port values allow the re-use of possible cached SSL session ids.
 * @param context
 * @param config
 * @param host
 * @param port
 * @return SSLEngine
 */
public static SSLEngine getOutboundSSLEngine(SSLContext context,SSLLinkConfig config,String host,int port){
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.entry(tc,"String_Node_Str" + host + "String_Node_Str"+ port);
  }
  SSLEngine engine=context.createSSLEngine(host,port);
  configureEngine(engine,FlowType.OUTBOUND,config);
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.exit(tc,"String_Node_Str" + engine.hashCode());
  }
  return engine;
}

Fixed version (ground truth):
/** 
 * Create an SSL engine with the input parameters. The host and port values allow the re-use of possible cached SSL session ids.
 * @param context
 * @param config
 * @param host
 * @param port
 * @return SSLEngine
 */
public static SSLEngine getOutboundSSLEngine(SSLContext context,SSLLinkConfig config,String host,int port){
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.entry(tc,"String_Node_Str" + host + "String_Node_Str"+ port);
  }
  SSLEngine engine=context.createSSLEngine(host,port);
  grizzlyAlpnNegotiator.tryToUseGrizzlyJdk8Alpn(engine);
  configureEngine(engine,FlowType.OUTBOUND,config);
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.exit(tc,"String_Node_Str" + engine.hashCode());
  }
  return engine;
}
Program: 34833
Project: 34833
Buggy source:
@Override public void run(){
synchronized (linkStatusSync) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + linkStatus + "String_Node_Str"+ hcDebug);
    }
    if (linkStatus != LINK_STATUS.WAIT_TO_SEND_GOAWAY) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
        Tr.debug(tc,"String_Node_Str" + "String_Node_Str" + hcDebug);
      }
      return;
    }
    linkStatus=LINK_STATUS.GOAWAY_SENDING;
  }
  try {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + "String_Node_Str" + hcDebug);
    }
    streamTable.get(0).sendGOAWAYFrame(new Http2Exception("String_Node_Str"));
  }
 catch (  Exception x) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + "String_Node_Str" + hcDebug + "String_Node_Str"+ x);
    }
  }
 finally {
    closeConnectionLink(e);
  }
}

Fixed version (ground truth):
@Override public void run(){
synchronized (linkStatusSync) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + linkStatus + "String_Node_Str"+ hcDebug);
    }
    if (linkStatus != LINK_STATUS.WAIT_TO_SEND_GOAWAY) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
        Tr.debug(tc,"String_Node_Str" + "String_Node_Str" + hcDebug);
      }
      return;
    }
    linkStatus=LINK_STATUS.GOAWAY_SENDING;
  }
  try {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + "String_Node_Str" + hcDebug);
    }
    if (e == null) {
      streamTable.get(0).sendGOAWAYFrame(new Http2Exception("String_Node_Str"));
    }
 else     if (e instanceof Http2Exception) {
      streamTable.get(0).sendGOAWAYFrame((Http2Exception)e);
    }
 else {
      streamTable.get(0).sendGOAWAYFrame(new Http2Exception(e.getMessage()));
    }
  }
 catch (  Exception x) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + "String_Node_Str" + hcDebug + "String_Node_Str"+ x);
    }
  }
 finally {
    closeConnectionLink(e);
  }
}
Program: 34834
Project: 34834
Buggy source:
@Trivial @Override public boolean handleContent(DDParser parser) throws ParseException {
  parser.skipSubtree();
  return true;
}

Fixed version (ground truth):
@Trivial @Override public boolean handleContent(DDParser parser) throws ParseException {
  return true;
}
Program: 34835
Project: 34835
Buggy source:
public static <T>T readYamlValue(String contents,Class<T> expectedType){
  org.yaml.snakeyaml.Yaml yaml=new org.yaml.snakeyaml.Yaml();
  return Json.mapper().convertValue(yaml.load(contents),expectedType);
}

Fixed version (ground truth):
public static <T>T readYamlValue(String contents,Class<T> expectedType){
  org.yaml.snakeyaml.Yaml yaml=new org.yaml.snakeyaml.Yaml(new SafeConstructor());
  return Json.mapper().convertValue(yaml.load(contents),expectedType);
}
Program: 34836
Project: 34836
Buggy source:
public static JsonNode readYamlTree(String contents){
  org.yaml.snakeyaml.Yaml yaml=new org.yaml.snakeyaml.Yaml();
  return Json.mapper().convertValue(yaml.load(contents),JsonNode.class);
}

Fixed version (ground truth):
public static JsonNode readYamlTree(String contents){
  org.yaml.snakeyaml.Yaml yaml=new org.yaml.snakeyaml.Yaml(new SafeConstructor());
  return Json.mapper().convertValue(yaml.load(contents),JsonNode.class);
}
Program: 34837
Project: 34837
Buggy source:
/** 
 * Finish building the current frame: process its payload and pass it to the Stream Processor
 * @throws ProtocolException
 */
public void processCompleteFrame() throws Http2Exception {
  Frame currentFrame=getCurrentFrame();
  boolean frameSizeError=false;
  try {
    currentFrame.processPayload(this);
  }
 catch (  FrameSizeException e) {
    if (!e.isConnectionError()) {
      frameSizeError=true;
    }
 else {
      throw e;
    }
  }
  int streamId=currentFrame.getStreamId();
  H2StreamProcessor stream=muxLink.getStream(streamId);
  if (stream != null && stream.isStreamClosed() && muxLink.significantlyPastCloseTime(streamId)) {
    if (tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + streamId);
    }
    throw new ProtocolException("String_Node_Str");
  }
  if (stream == null && streamId < muxLink.getHighestClientStreamId()) {
    throw new ProtocolException("String_Node_Str" + streamId);
  }
  if (stream == null && (streamId != 0) && (streamId % 2 == 0)) {
    throw new ProtocolException("String_Node_Str" + streamId);
  }
  if (frameSizeError) {
    currentFrame=new FrameRstStream(streamId,Constants.FRAME_SIZE_ERROR,false);
  }
  if (stream == null) {
    stream=startNewInboundSession(streamId);
  }
  stream.processNextFrame(currentFrame,Direction.READ_IN);
}

Fixed version (ground truth):
/** 
 * Finish building the current frame: process its payload and pass it to the Stream Processor
 * @throws ProtocolException
 */
public void processCompleteFrame() throws Http2Exception {
  Frame currentFrame=getCurrentFrame();
  boolean frameSizeError=false;
  try {
    currentFrame.processPayload(this);
  }
 catch (  FrameSizeException e) {
    if (!e.isConnectionError()) {
      frameSizeError=true;
    }
 else {
      throw e;
    }
  }
catch (  Exception e) {
    throw new ProtocolException("String_Node_Str" + currentFrame);
  }
  int streamId=currentFrame.getStreamId();
  H2StreamProcessor stream=muxLink.getStream(streamId);
  if (stream != null && stream.isStreamClosed() && muxLink.significantlyPastCloseTime(streamId)) {
    if (tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + streamId);
    }
    throw new ProtocolException("String_Node_Str");
  }
  if (stream == null && (streamId != 0) && (streamId % 2 == 0)) {
    throw new ProtocolException("String_Node_Str" + streamId);
  }
  if (frameSizeError) {
    currentFrame=new FrameRstStream(streamId,Constants.FRAME_SIZE_ERROR,false);
  }
  if (stream == null) {
    stream=startNewInboundSession(streamId);
  }
  stream.processNextFrame(currentFrame,Direction.READ_IN);
}
Program: 34839
Project: 34839
Buggy source:
public void triggerStreamClose(H2StreamProcessor streamProcessor){
  if (closeTable.size() >= 512) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str");
    }
    purgeCloseTable();
  }
  streamProcessor.setCloseTime(System.nanoTime());
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + streamProcessor.myID);
  }
  closeTable.put(streamProcessor.myID,streamProcessor);
  streamTable.remove(streamProcessor.myID);
}

Fixed version (ground truth):
public void triggerStreamClose(H2StreamProcessor streamProcessor){
  if (closeTable.size() >= 512) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str");
    }
    purgeCloseTable();
  }
  streamProcessor.setCloseTime(System.nanoTime());
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + streamProcessor.getId());
  }
  closeTable.put(streamProcessor.getId(),streamProcessor);
  streamTable.remove(streamProcessor.getId());
}
Program: 34840
Project: 34840
Buggy source:
public H2StreamProcessor getStream(int streamID){
  H2StreamProcessor streamProcessor=null;
  streamProcessor=streamTable.get(streamID);
  if (streamProcessor == null) {
    streamProcessor=closeTable.get(streamID);
  }
  return streamProcessor;
}

Fixed version (ground truth):
/** 
 * Get the stream processor for a given stream ID, if it exists
 * @param streamID of the desired stream
 * @return a stream object if it's in the open or close table, or null if theID is new or has already been removed from the close table
 */
public H2StreamProcessor getStream(int streamID){
  H2StreamProcessor streamProcessor=null;
  streamProcessor=streamTable.get(streamID);
  if (streamProcessor == null) {
    streamProcessor=closeTable.get(streamID);
  }
  return streamProcessor;
}
Program: 34842
Project: 34842
Buggy source:
@Override public void destroy(Exception e){
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str");
  }
  H2StreamProcessor stream;
  for (  Integer i : streamTable.keySet()) {
    stream=streamTable.get(i);
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + stream + "String_Node_Str"+ stream.myID);
    }
    if (stream.myID != 0) {
      stream.h2HttpInboundLinkWrap.destroy(e);
    }
  }
  initialVC=null;
  frameReadProcessor=null;
  h2MuxReadCallback=null;
  h2MuxTCPConnectionContext=null;
  h2MuxTCPReadContext=null;
  h2MuxTCPWriteContext=null;
  connectionSettings=null;
  readContextTable=null;
  writeContextTable=null;
  super.destroy(e);
}

Fixed version (ground truth):
@Override public void destroy(Exception e){
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str");
  }
  H2StreamProcessor stream;
  for (  Integer i : streamTable.keySet()) {
    stream=streamTable.get(i);
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + stream + "String_Node_Str"+ stream.getId());
    }
    if (stream.getId() != 0) {
      stream.getWrappedInboundLink().destroy(e);
    }
  }
  initialVC=null;
  frameReadProcessor=null;
  h2MuxReadCallback=null;
  h2MuxTCPConnectionContext=null;
  h2MuxTCPReadContext=null;
  h2MuxTCPWriteContext=null;
  connectionSettings=null;
  readContextTable=null;
  writeContextTable=null;
  super.destroy(e);
}
Program: 34843
Project: 34843
Buggy source:
public H2StreamProcessor createNewInboundLink(Integer streamID){
  if ((streamID & 1) == 0) {
    if (streamID > highestLocalStreamId) {
      highestLocalStreamId=streamID;
    }
  }
 else {
    if (streamID > highestClientStreamId) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
        Tr.debug(tc,"String_Node_Str" + streamID);
      }
      highestClientStreamId=streamID;
    }
  }
  H2VirtualConnectionImpl h2VC=new H2VirtualConnectionImpl(initialVC);
  h2VC.getStateMap().remove(HttpDispatcherLink.LINK_ID);
  H2HttpInboundLinkWrap link=new H2HttpInboundLinkWrap(httpInboundChannel,h2VC,streamID,this);
  H2StreamProcessor stream=new H2StreamProcessor(streamID,link,this);
  writeQ.addNewNodeToQ(streamID,Node.ROOT_STREAM_ID,Node.DEFAULT_NODE_PRIORITY,false);
  streamTable.put(streamID,stream);
  return stream;
}

Fixed version (ground truth):
public H2StreamProcessor createNewInboundLink(Integer streamID){
  H2VirtualConnectionImpl h2VC=new H2VirtualConnectionImpl(initialVC);
  h2VC.getStateMap().remove(HttpDispatcherLink.LINK_ID);
  H2HttpInboundLinkWrap link=new H2HttpInboundLinkWrap(httpInboundChannel,h2VC,streamID,this);
  H2StreamProcessor stream=new H2StreamProcessor(streamID,link,this);
  writeQ.addNewNodeToQ(streamID,Node.ROOT_STREAM_ID,Node.DEFAULT_NODE_PRIORITY,false);
  streamTable.put(streamID,stream);
  return stream;
}
Program: 34844
Project: 34844
Buggy source:
/** 
 * Tests that the expected exception is thrown if the MBean resume method is issued when no pauseable components exist
 * @throws Exception
 */
@AllowedFFDC(PAUSEABLE_EXCEPTION_CLASS) @Test public void testResumeAllNoPauseableComponents() throws Exception {
  final String METHOD_NAME="String_Node_Str";
  Log.entering(c,METHOD_NAME);
  boolean noException=true;
  restoreSavedConfig=true;
  server.setMarkToEndOfLog();
  server.changeFeatures(Arrays.asList("String_Node_Str","String_Node_Str"));
  assertNotNull("String_Node_Str",server.waitForConfigUpdateInLogUsingMark(null,true));
  try {
    server.setMarkToEndOfLog();
    mbean.resume();
  }
 catch (  MBeanException e) {
    Log.info(c,METHOD_NAME,"String_Node_Str" + e.getCause());
    noException=false;
  }
  final String res=server.waitForStringInLog("String_Node_Str");
  if (noException && ("String_Node_Str".equals(res) || res == null)) {
    fail("String_Node_Str");
  }
  Log.exiting(c,METHOD_NAME);
}

Fixed version (ground truth):
/** 
 * Tests that the expected exception is thrown if the MBean resume all method is issued when no pauseable components exist
 * @throws Exception
 */
@ExpectedFFDC(PAUSEABLE_EXCEPTION_CLASS) @Test public void testResumeAllNoPauseableComponents() throws Exception {
  final String METHOD_NAME="String_Node_Str";
  Log.entering(c,METHOD_NAME);
  restoreSavedConfig=true;
  server.setMarkToEndOfLog();
  server.changeFeatures(Arrays.asList("String_Node_Str","String_Node_Str"));
  assertNotNull("String_Node_Str",server.waitForConfigUpdateInLogUsingMark(null,true));
  try {
    server.setMarkToEndOfLog();
    mbean.resume();
    fail("String_Node_Str");
  }
 catch (  MBeanException e) {
  }
  assertNotNull("String_Node_Str",server.waitForStringInLog("String_Node_Str"));
  Log.exiting(c,METHOD_NAME);
}
Program: 34845
Project: 34845
Buggy source:
/** 
 * Tests that the expected warning log is emitted if the MBean pause method is issued with no targets when no pauseable components exist
 * @throws Exception
 */
@AllowedFFDC(PAUSEABLE_EXCEPTION_CLASS) @Test public void testPauseAllNoPauseableComponents() throws Exception {
  final String METHOD_NAME="String_Node_Str";
  Log.entering(c,METHOD_NAME);
  boolean noException=true;
  restoreSavedConfig=true;
  server.setMarkToEndOfLog();
  server.changeFeatures(Arrays.asList("String_Node_Str","String_Node_Str"));
  assertNotNull("String_Node_Str",server.waitForConfigUpdateInLogUsingMark(null,true));
  try {
    server.setMarkToEndOfLog();
    mbean.pause();
  }
 catch (  MBeanException e) {
    noException=false;
  }
  final String res=server.waitForStringInLog("String_Node_Str");
  if (noException && ("String_Node_Str".equals(res) || res == null)) {
    fail("String_Node_Str");
  }
  Log.exiting(c,METHOD_NAME);
}

Fixed version (ground truth):
/** 
 * Tests that the expected exception is emitted if the MBean pause all method is issued when no pauseable components exist
 * @throws Exception
 */
@ExpectedFFDC(PAUSEABLE_EXCEPTION_CLASS) @Test public void testPauseAllNoPauseableComponents() throws Exception {
  final String METHOD_NAME="String_Node_Str";
  Log.entering(c,METHOD_NAME);
  restoreSavedConfig=true;
  server.setMarkToEndOfLog();
  server.changeFeatures(Arrays.asList("String_Node_Str","String_Node_Str"));
  assertNotNull("String_Node_Str",server.waitForConfigUpdateInLogUsingMark(null,true));
  try {
    server.setMarkToEndOfLog();
    mbean.pause();
    fail("String_Node_Str");
  }
 catch (  MBeanException e) {
  }
  assertNotNull("String_Node_Str",server.waitForStringInLog("String_Node_Str"));
  Log.exiting(c,METHOD_NAME);
}
Program: 34848
Project: 34848
Buggy source:
public long readCount(long numBytes,WsByteBuffer[] req){
  if (read(numBytes,req) != null) {
    return actualReadCount;
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * Read the http header and data bytes for this stream
 * @param numBytes the number of bytes requested
 * @param requestBuffers an array of buffers to copy the read data into
 * @return the number of bytes that were actually copied into requestBuffers
 */
public long readCount(long numBytes,WsByteBuffer[] requestBuffers){
  if (read(numBytes,requestBuffers) != null) {
    return actualReadCount;
  }
  return 0;
}
Program: 34849
Project: 34849
Buggy source:
/** 
 * Put the payload from the current Data frame into the read buffer that will be passed to the webcontainer
 */
private void getBodyFromFrame(){
  if (currentFrame.getFrameType() == FrameTypes.DATA) {
    dataPayload=((FrameData)currentFrame).getData();
    WsByteBufferPoolManager bufManager=HttpDispatcher.getBufferManager();
    WsByteBuffer buf=bufManager.allocate(this.dataPayload.length);
    buf.put(this.dataPayload);
    buf.flip();
    moveDataIntoReadBufferArray(buf);
  }
}

Fixed version (ground truth):
/** 
 * Grab the data from the current frame
 */
private void getBodyFromFrame(){
  if (dataPayload == null) {
    dataPayload=new ArrayList<byte[]>();
  }
  if (currentFrame.getFrameType() == FrameTypes.DATA) {
    dataPayload.add(((FrameData)currentFrame).getData());
  }
}
Program: 34850
Project: 34850
Buggy source:
private void processOpen(Constants.Direction direction) throws ProtocolException, FlowControlException {
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + myID);
  }
  if (direction == Constants.Direction.READ_IN) {
    if (frameType == FrameTypes.DATA) {
      getBodyFromFrame();
      if (currentFrame.flagEndStreamSet()) {
        endStream=true;
        updateStreamState(StreamState.HALF_CLOSED_REMOTE);
        setReadyForRead();
      }
    }
  }
 else {
    if (frameType == FrameTypes.PUSH_PROMISE) {
    }
 else     if (frameType == FrameTypes.HEADERS || frameType == FrameTypes.CONTINUATION) {
      if (currentFrame.flagEndHeadersSet()) {
        setContinuationFrameExpected(false);
        if (currentFrame.flagEndStreamSet()) {
          endStream=true;
          updateStreamState(StreamState.HALF_CLOSED_LOCAL);
        }
      }
 else {
        setContinuationFrameExpected(true);
        if (currentFrame.flagEndStreamSet()) {
          endStream=true;
        }
      }
    }
    boolean writeCompleted=writeFrameSync();
    if (frameType == FrameTypes.DATA && writeCompleted && currentFrame.flagEndStreamSet()) {
      endStream=true;
      updateStreamState(StreamState.HALF_CLOSED_LOCAL);
    }
  }
}

Fixed version (ground truth):
private void processOpen(Constants.Direction direction) throws ProtocolException, FlowControlException {
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + myID);
  }
  if (direction == Constants.Direction.READ_IN) {
    if (frameType == FrameTypes.DATA) {
      getBodyFromFrame();
      if (currentFrame.flagEndStreamSet()) {
        endStream=true;
        processCompleteData();
        updateStreamState(StreamState.HALF_CLOSED_REMOTE);
        setReadyForRead();
      }
    }
  }
 else {
    if (frameType == FrameTypes.PUSH_PROMISE) {
    }
 else     if (frameType == FrameTypes.HEADERS || frameType == FrameTypes.CONTINUATION) {
      if (currentFrame.flagEndHeadersSet()) {
        setContinuationFrameExpected(false);
        if (currentFrame.flagEndStreamSet()) {
          endStream=true;
          updateStreamState(StreamState.HALF_CLOSED_LOCAL);
        }
      }
 else {
        setContinuationFrameExpected(true);
        if (currentFrame.flagEndStreamSet()) {
          endStream=true;
        }
      }
    }
    boolean writeCompleted=writeFrameSync();
    if (frameType == FrameTypes.DATA && writeCompleted && currentFrame.flagEndStreamSet()) {
      endStream=true;
      updateStreamState(StreamState.HALF_CLOSED_LOCAL);
    }
  }
}
Program: 34851
Project: 34851
Buggy source:
/** 
 * Appends the header block fragment in the current header frame to this stream's incomplete header block
 */
private void getHeadersFromFrame(){
  byte[] hbf=null;
  if (currentFrame.getFrameType() == FrameTypes.HEADERS) {
    hbf=((FrameHeaders)currentFrame).getHeaderBlockFragment();
  }
 else   if (currentFrame.getFrameType() == FrameTypes.CONTINUATION) {
    hbf=((FrameContinuation)currentFrame).getHeaderBlockFragment();
  }
  if (hbf != null) {
    if (headerBlock == null) {
      headerBlock=hbf;
    }
 else {
      headerBlock=concatenateArrays(headerBlock,hbf);
    }
  }
}

Fixed version (ground truth):
/** 
 * Appends the header block fragment in the current header frame to this stream's incomplete header block
 */
private void getHeadersFromFrame(){
  byte[] hbf=null;
  if (currentFrame.getFrameType() == FrameTypes.HEADERS) {
    hbf=((FrameHeaders)currentFrame).getHeaderBlockFragment();
  }
 else   if (currentFrame.getFrameType() == FrameTypes.CONTINUATION) {
    hbf=((FrameContinuation)currentFrame).getHeaderBlockFragment();
  }
  if (hbf != null) {
    if (headerBlock == null) {
      headerBlock=new ArrayList<byte[]>();
    }
    headerBlock.add(hbf);
  }
}
Program: 34853
Project: 34853
Buggy source:
private void moveDataIntoReadBufferArray(WsByteBuffer newBuf){
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + myID + "String_Node_Str"+ newBuf);
  }
  if (newBuf != null) {
    int size=newBuf.remaining();
    streamReadReady[streamReadBufferIndex]=newBuf;
    streamReadBufferIndex++;
    streamReadSize+=size;
  }
}

Fixed version (ground truth):
/** 
 * Add a buffer to the list of buffers that will be sent to the WebContainer when a read is requested
 * @param newReadBuffer
 */
private void moveDataIntoReadBufferArray(WsByteBuffer newReadBuffer){
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + myID + "String_Node_Str"+ newReadBuffer);
  }
  if (newReadBuffer != null) {
    int size=newReadBuffer.remaining();
    if (size > 0) {
      streamReadReady.add(newReadBuffer);
      streamReadSize+=size;
      this.readLatch.countDown();
    }
  }
}
Program: 34854
Project: 34854
Buggy source:
@Override public long read(long numBytes,int timeout) throws IOException {
  long readCount=0;
  H2StreamProcessor p=muxLink.getStreamProcessor(streamID);
  while (true) {
    try {
      readCount=p.readCount(numBytes,this.getBuffers());
      if ((readCount != 0) || (numBytes == 0)) {
        return readCount;
      }
      Thread.sleep(250);
    }
 catch (    InterruptedException e) {
    }
  }
}

Fixed version (ground truth):
/** 
 * Get bytes from the stream processor associated with this read context
 */
@Override public long read(long numBytes,int timeout) throws IOException {
  long readCount=0;
  H2StreamProcessor p=muxLink.getStreamProcessor(streamID);
  try {
    p.getReadLatch().await(timeout,TimeUnit.MILLISECONDS);
    readCount=p.readCount(numBytes,this.getBuffers());
  }
 catch (  InterruptedException e) {
    throw new IOException("String_Node_Str" + e);
  }
  return readCount;
}
Program: 34856
Project: 34856
Buggy source:
public void writeFramesSync(CopyOnWriteArrayList<Frame> frames){
  if (frames == null) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str");
    }
    return;
  }
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + frames.size());
  }
  Iterator<Frame> i=frames.iterator();
  while (i.hasNext()) {
    try {
      Frame currentFrame=i.next();
      H2StreamProcessor streamProcessor=muxLink.getStreamProcessor(streamID);
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
        Tr.debug(tc,"String_Node_Str" + currentFrame.getFrameType());
      }
      streamProcessor.processNextFrame(currentFrame,Direction.WRITING_OUT);
    }
 catch (    Http2Exception e) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
        Tr.debug(tc,"String_Node_Str" + e.getErrorString());
      }
      try {
        muxLink.getStreamProcessor(0).sendGOAWAYFrame(e);
      }
 catch (      ProtocolException x) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
          Tr.debug(tc,"String_Node_Str" + x);
        }
      }
    }
catch (    Exception e) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
        Tr.debug(tc,"String_Node_Str" + e);
      }
    }
  }
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str");
  }
}

Fixed version (ground truth):
public void writeFramesSync(CopyOnWriteArrayList<Frame> frames){
  if (frames == null) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str");
    }
    return;
  }
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + frames.size());
  }
  Iterator<Frame> i=frames.iterator();
  while (i.hasNext()) {
    try {
      Frame currentFrame=i.next();
      H2StreamProcessor streamProcessor=muxLink.getStreamProcessor(streamID);
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
        Tr.debug(tc,"String_Node_Str" + currentFrame.getFrameType());
      }
      if (streamProcessor != null) {
        streamProcessor.processNextFrame(currentFrame,Direction.WRITING_OUT);
      }
 else {
        throw new StreamClosedException("String_Node_Str" + streamID + "String_Node_Str");
      }
    }
 catch (    Http2Exception e) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
        Tr.debug(tc,"String_Node_Str" + e.getErrorString());
      }
      try {
        muxLink.getStreamProcessor(0).sendGOAWAYFrame(e);
      }
 catch (      ProtocolException x) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
          Tr.debug(tc,"String_Node_Str" + x);
        }
      }
    }
catch (    Exception e) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
        Tr.debug(tc,"String_Node_Str" + e);
      }
    }
  }
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str");
  }
}
Program: 34860
Project: 34860
Buggy source:
/** 
 * Put the payload from the current Data frame into the read buffer that will be passed to the webcontainer
 */
private void getBodyFromFrame(){
  if (currentFrame.getFrameType() == FrameTypes.DATA) {
    dataPayload=((FrameData)currentFrame).getData();
    WsByteBufferPoolManager bufManager=HttpDispatcher.getBufferManager();
    WsByteBuffer buf=bufManager.allocate(this.dataPayload.length);
    buf.put(this.dataPayload);
    moveDataIntoReadBufferArray(buf);
  }
}

Fixed version (ground truth):
/** 
 * Put the payload from the current Data frame into the read buffer that will be passed to the webcontainer
 */
private void getBodyFromFrame(){
  if (currentFrame.getFrameType() == FrameTypes.DATA) {
    dataPayload=((FrameData)currentFrame).getData();
    WsByteBufferPoolManager bufManager=HttpDispatcher.getBufferManager();
    WsByteBuffer buf=bufManager.allocate(this.dataPayload.length);
    buf.put(this.dataPayload);
    buf.flip();
    moveDataIntoReadBufferArray(buf);
  }
}
Program: 34861
Project: 34861
Buggy source:
/** 
 * Called by the device side channel when a new request is ready for work.
 * @param inVC
 */
@Override public void ready(VirtualConnection inVC){
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.entry(tc,"String_Node_Str" + this + "String_Node_Str"+ inVC);
  }
  this.myTSC=(TCPConnectionContext)getDeviceLink().getChannelAccessor();
  HttpInboundServiceContextImpl sc=getHTTPContext();
  sc.init(this.myTSC,this,inVC,getChannel().getHttpConfig());
  if (getChannel().getHttpConfig().getDebugLog().isEnabled(DebugLog.Level.INFO)) {
    getChannel().getHttpConfig().getDebugLog().log(DebugLog.Level.INFO,HttpMessages.MSG_CONN_STARTING,sc);
  }
  if (this.myTSC.getSSLContext() != null && !sc.isH2Connection() && this.myTSC.getSSLContext().getAlpnProtocol().equals("String_Node_Str") && checkForH2MagicString(sc)) {
    alreadyH2Upgraded=true;
    handleHttp2();
  }
 else {
    processRequest();
  }
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.exit(tc,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Called by the device side channel when a new request is ready for work.
 * @param inVC
 */
@Override public void ready(VirtualConnection inVC){
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.entry(tc,"String_Node_Str" + this + "String_Node_Str"+ inVC);
  }
  this.myTSC=(TCPConnectionContext)getDeviceLink().getChannelAccessor();
  HttpInboundServiceContextImpl sc=getHTTPContext();
  sc.init(this.myTSC,this,inVC,getChannel().getHttpConfig());
  if (getChannel().getHttpConfig().getDebugLog().isEnabled(DebugLog.Level.INFO)) {
    getChannel().getHttpConfig().getDebugLog().log(DebugLog.Level.INFO,HttpMessages.MSG_CONN_STARTING,sc);
  }
  if (this.myTSC.getSSLContext() != null && !sc.isH2Connection() && this.myTSC.getSSLContext().getAlpnProtocol() != null && this.myTSC.getSSLContext().getAlpnProtocol().equals("String_Node_Str") && checkForH2MagicString(sc)) {
    alreadyH2Upgraded=true;
    handleHttp2();
  }
 else {
    processRequest();
  }
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.exit(tc,"String_Node_Str");
  }
}
Program: 34862
Project: 34862
Buggy source:
@SuppressWarnings("String_Node_Str") private LoginToContinueInterceptorTest withSetCookies() throws Exception {
  final String ORIGINAL_URL="String_Node_Str";
  final StringBuffer sb=new StringBuffer(ORIGINAL_URL);
  mockery.checking(new Expectations(){
{
      one(req).getQueryString();
      will(returnValue(null));
      one(req).getRequestURL();
      will(returnValue(sb));
      one(req).isSecure();
      will(returnValue(true));
      one(wasc).getSSORequiresSSL();
      will(returnValue(false));
      one(req).getMethod();
      will(returnValue("String_Node_Str"));
      one(ruh).setReferrerURLCookie(with(any(HttpServletRequest.class)),with(any(AuthenticationResult.class)),with(any(String.class)));
    }
  }
);
  return this;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private LoginToContinueInterceptorTest withSetCookies() throws Exception {
  final String ORIGINAL_URL="String_Node_Str";
  final StringBuffer sb=new StringBuffer(ORIGINAL_URL);
  mockery.checking(new Expectations(){
{
      one(req).getQueryString();
      will(returnValue(null));
      one(req).getRequestURL();
      will(returnValue(sb));
      one(req).isSecure();
      will(returnValue(true));
      one(wasc).getSSORequiresSSL();
      will(returnValue(false));
      between(1,2).of(req).getMethod();
      will(returnValue("String_Node_Str"));
      one(ruh).setReferrerURLCookie(with(any(HttpServletRequest.class)),with(any(AuthenticationResult.class)),with(any(String.class)));
    }
  }
);
  return this;
}
Program: 34863
Project: 34863
Buggy source:
/** 
 * Verify that the result of converting the newly submitted value is <i>equal</i> to the value property of one of the child SelectItem objects. If this is not true, a validation error is reported.
 * @see javax.faces.component.UIInput#validateValue(javax.faces.context.FacesContext,java.lang.Object)
 */
@Override protected void validateValue(FacesContext context,Object value){
  super.validateValue(context,value);
  if (!isValid() || value == null) {
    return;
  }
  Converter converter=getConverter();
  Collection<SelectItem> items=new ArrayList<SelectItem>();
  for (Iterator<SelectItem> iter=new _SelectItemsIterator(this,context); iter.hasNext(); ) {
    items.add(iter.next());
  }
  if (_SelectItemsUtil.matchValue(context,this,value,items.iterator(),converter)) {
    if (!this.isRequired()) {
      return;
    }
    if (!_SelectItemsUtil.isNoSelectionOption(context,this,value,items.iterator(),converter)) {
      return;
    }
  }
  _MessageUtils.addErrorMessage(context,this,INVALID_MESSAGE_ID,new Object[]{_MessageUtils.getLabel(context,this)});
  setValid(false);
}

Fixed version (ground truth):
/** 
 * Verify that the result of converting the newly submitted value is <i>equal</i> to the value property of one of the child SelectItem objects. If this is not true, a validation error is reported.
 * @see javax.faces.component.UIInput#validateValue(javax.faces.context.FacesContext,java.lang.Object)
 */
@Override protected void validateValue(FacesContext context,Object value){
  super.validateValue(context,value);
  if (!isValid() || value == null) {
    return;
  }
  Converter converter=getConverter();
  Collection<SelectItem> items=new ArrayList<SelectItem>();
  for (Iterator<SelectItem> iter=new _SelectItemsIterator(this,context); iter.hasNext(); ) {
    items.add(iter.next());
  }
  if (_SelectItemsUtil.matchValue(context,this,value,items.iterator(),converter)) {
    if (!this.isRequired()) {
      return;
    }
    if (!_SelectItemsUtil.isNoSelectionOption(context,this,value,items.iterator(),converter)) {
      return;
    }
  }
  if (selectItemValueFound) {
    return;
  }
  _MessageUtils.addErrorMessage(context,this,INVALID_MESSAGE_ID,new Object[]{_MessageUtils.getLabel(context,this)});
  setValid(false);
}
Program: 34865
Project: 34865
Buggy source:
@Test public void testRememberMeHttpNoCookie() throws Exception {
  HttpResponse httpResponse=executeGetRequestBasicAuthCreds(httpclient,urlBase + queryString,javaeesec_basicRoleUser,javaeesec_basicRolePwd);
  String response=processResponse(httpResponse,HttpServletResponse.SC_OK);
  verifyUserResponse(response,Constants.getUserPrincipalFound + Constants.javaeesec_basicRoleUser,Constants.getRemoteUserFound + Constants.javaeesec_basicRoleUser);
  validateNoCookie(httpResponse,REMEMBERME_COOKIE_NAME);
}

Fixed version (ground truth):
@Test public void testRememberMeHttpNoCookie() throws Exception {
  HttpResponse httpResponse=executeGetRequestBasicAuthCreds(httpclient,urlBase + queryString,Constants.javaeesec_basicRoleUser,Constants.javaeesec_basicRolePwd);
  String response=processResponse(httpResponse,HttpServletResponse.SC_OK);
  verifyUserResponse(response,Constants.getUserPrincipalFound + Constants.javaeesec_basicRoleUser,Constants.getRemoteUserFound + Constants.javaeesec_basicRoleUser);
  validateNoCookie(httpResponse,REMEMBERME_COOKIE_NAME);
}
Program: 34866
Project: 34866
Buggy source:
protected AuthenticationStatus gotoLoginPage(Properties props,HttpServletRequest req,HttpServletResponse res,HttpMessageContext httpMessageContext) throws IOException {
  String loginPage=(String)props.get(JavaEESecConstants.LOGIN_TO_CONTINUE_LOGINPAGE);
  String errorPage=(String)props.get(JavaEESecConstants.LOGIN_TO_CONTINUE_ERRORPAGE);
  boolean useForwardToLogin=getUseForwardToLogin();
  AuthenticationStatus status=AuthenticationStatus.SEND_CONTINUE;
  MessageInfo msgInfo=httpMessageContext.getMessageInfo();
  WebRequest webRequest=(WebRequest)msgInfo.getMap().get(JaspiConstants.SECURITY_WEB_REQUEST);
  updateFormLoginConfiguration(loginPage,errorPage,webRequest.getSecurityMetadata());
  setCookies(req,res);
  if (useForwardToLogin) {
    if (tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str");
    }
    RequestDispatcher rd=req.getRequestDispatcher(loginPage);
    try {
      rd.forward(req,res);
    }
 catch (    Exception e) {
      status=AuthenticationStatus.SEND_FAILURE;
    }
  }
 else {
    res.setStatus(HttpServletResponse.SC_FOUND);
    String loginUrl=getLoginUrl(req,loginPage);
    res.sendRedirect(res.encodeURL(loginUrl));
  }
  return status;
}

Fixed version (ground truth):
protected AuthenticationStatus gotoLoginPage(Properties props,HttpServletRequest req,HttpServletResponse res,HttpMessageContext httpMessageContext) throws IOException {
  String loginPage=(String)props.get(JavaEESecConstants.LOGIN_TO_CONTINUE_LOGINPAGE);
  String errorPage=(String)props.get(JavaEESecConstants.LOGIN_TO_CONTINUE_ERRORPAGE);
  boolean useForwardToLogin=getUseForwardToLogin();
  AuthenticationStatus status=AuthenticationStatus.SEND_CONTINUE;
  MessageInfo msgInfo=httpMessageContext.getMessageInfo();
  WebRequest webRequest=(WebRequest)msgInfo.getMap().get(JaspiConstants.SECURITY_WEB_REQUEST);
  updateFormLoginConfiguration(loginPage,errorPage,webRequest.getSecurityMetadata());
  setCookies(req,res);
  if (useForwardToLogin) {
    if (tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str");
    }
    RequestDispatcher rd=req.getRequestDispatcher(loginPage);
    try {
      rd.forward(req,res);
    }
 catch (    Exception e) {
      status=AuthenticationStatus.SEND_FAILURE;
    }
  }
 else {
    res.setStatus(HttpServletResponse.SC_FOUND);
    String loginUrl=getUrl(req,loginPage);
    res.sendRedirect(res.encodeURL(loginUrl));
  }
  return status;
}
Program: 34867
Project: 34867
Buggy source:
@AroundInvoke public Object intercept(InvocationContext ic) throws Exception {
  Object result=null;
  if (isMethodToIntercept(ic)) {
    if (mpp != null) {
      result=ic.proceed();
      Object[] params=ic.getParameters();
      HttpServletRequest req=(HttpServletRequest)params[0];
      HttpServletResponse res=(HttpServletResponse)params[1];
      Class hamClass=getClass(ic);
      if (result.equals(AuthenticationStatus.SEND_CONTINUE)) {
        HttpMessageContext mc=(HttpMessageContext)params[2];
        result=gotoLoginPage(mpp.getAuthMechProperties(hamClass),req,res,mc);
      }
 else       if (result.equals(AuthenticationStatus.SUCCESS)) {
        boolean isCustomForm=isCustomForm(hamClass);
        postLoginProcess(req,res,isCustomForm);
      }
    }
 else {
      Tr.error(tc,"String_Node_Str");
      result=AuthenticationStatus.SEND_FAILURE;
    }
  }
 else {
    result=ic.proceed();
  }
  return result;
}

Fixed version (ground truth):
@AroundInvoke public Object intercept(InvocationContext ic) throws Exception {
  Object result=null;
  if (isMethodToIntercept(ic)) {
    if (mpp != null) {
      result=ic.proceed();
      Object[] params=ic.getParameters();
      HttpServletRequest req=(HttpServletRequest)params[0];
      HttpServletResponse res=(HttpServletResponse)params[1];
      HttpMessageContext hmc=(HttpMessageContext)params[2];
      AuthenticationParameters authParams=hmc.getAuthParameters();
      Class hamClass=getClass(ic);
      if (!isNewAuth(authParams)) {
        if (result.equals(AuthenticationStatus.SEND_CONTINUE)) {
          result=gotoLoginPage(mpp.getAuthMechProperties(hamClass),req,res,hmc);
        }
 else         if (result.equals(AuthenticationStatus.SUCCESS)) {
          boolean isCustomForm=isCustomForm(hamClass);
          postLoginProcess(req,res,isCustomForm);
        }
 else         if (result.equals(AuthenticationStatus.SEND_FAILURE)) {
          if (isCustomForm(hamClass)) {
            rediectErrorPage(mpp.getAuthMechProperties(hamClass),req,res);
          }
        }
      }
    }
 else {
      Tr.error(tc,"String_Node_Str");
      result=AuthenticationStatus.SEND_FAILURE;
    }
  }
 else {
    result=ic.proceed();
  }
  return result;
}
Program: 34868
Project: 34868
Buggy source:
/** 
 * valid method. valid objects. Make sure that AuthenticationStatus.SUCCESS is returned along with redirection to the original url.
 */
@Test public void testInterceptContinueFormDefault() throws Exception {
  isInterceptedMethod=true;
  ltci.setMPP(mpp);
  Properties props=new Properties();
  props.put(JavaEESecConstants.LOGIN_TO_CONTINUE_LOGINPAGE,LOGIN_PAGE);
  props.put(JavaEESecConstants.LOGIN_TO_CONTINUE_ERRORPAGE,ERROR_PAGE);
  Object expect=AuthenticationStatus.SEND_CONTINUE;
  String storedReq="String_Node_Str";
  String requestUrl="String_Node_Str";
  withInvocationContext(expect).withProps(props).withParams().withReferrer().withSetCookies().withForward(LOGIN_PAGE).withNoELP();
  ltci.initialize(ici);
  assertEquals("String_Node_Str",expect,ltci.intercept(icm));
}

Fixed version (ground truth):
/** 
 * valid method. valid objects. Make sure that AuthenticationStatus.SUCCESS is returned along with redirection to the original url.
 */
@Test public void testInterceptContinueFormDefault() throws Exception {
  isInterceptedMethod=true;
  ltci.setMPP(mpp);
  Properties props=new Properties();
  props.put(JavaEESecConstants.LOGIN_TO_CONTINUE_LOGINPAGE,LOGIN_PAGE);
  props.put(JavaEESecConstants.LOGIN_TO_CONTINUE_ERRORPAGE,ERROR_PAGE);
  Object expect=AuthenticationStatus.SEND_CONTINUE;
  String storedReq="String_Node_Str";
  String requestUrl="String_Node_Str";
  withInvocationContext(expect).withProps(props).withParams().withReferrer().withSetCookies().withForward(LOGIN_PAGE).withNoELP().withAuthParams();
  ltci.initialize(ici);
  assertEquals("String_Node_Str",expect,ltci.intercept(icm));
}
Program: 34869
Project: 34869
Buggy source:
/** 
 * valid method. valid objects. Make sure that AuthenticationStatus.SUCCESS is returned along with redirection to the original url.
 */
@Test public void testInterceptContinueFormRedirect() throws Exception {
  isInterceptedMethod=true;
  ltci.setMPP(mpp);
  Properties props=new Properties();
  props.put(JavaEESecConstants.LOGIN_TO_CONTINUE_LOGINPAGE,LOGIN_PAGE);
  props.put(JavaEESecConstants.LOGIN_TO_CONTINUE_ERRORPAGE,ERROR_PAGE);
  props.put(JavaEESecConstants.LOGIN_TO_CONTINUE_USEFORWARDTOLOGIN,Boolean.FALSE);
  Object expect=AuthenticationStatus.SEND_CONTINUE;
  String storedReq="String_Node_Str";
  String requestUrl="String_Node_Str";
  withInvocationContext(expect).withProps(props).withParams().withReferrer().withSetCookies().withRedirect(LOGIN_PAGE).withNoELP();
  ltci.initialize(ici);
  assertEquals("String_Node_Str",expect,ltci.intercept(icm));
}

Fixed version (ground truth):
/** 
 * valid method. valid objects. Make sure that AuthenticationStatus.SUCCESS is returned along with redirection to the original url.
 */
@Test public void testInterceptContinueFormRedirect() throws Exception {
  isInterceptedMethod=true;
  ltci.setMPP(mpp);
  Properties props=new Properties();
  props.put(JavaEESecConstants.LOGIN_TO_CONTINUE_LOGINPAGE,LOGIN_PAGE);
  props.put(JavaEESecConstants.LOGIN_TO_CONTINUE_ERRORPAGE,ERROR_PAGE);
  props.put(JavaEESecConstants.LOGIN_TO_CONTINUE_USEFORWARDTOLOGIN,Boolean.FALSE);
  Object expect=AuthenticationStatus.SEND_CONTINUE;
  String storedReq="String_Node_Str";
  String requestUrl="String_Node_Str";
  withInvocationContext(expect).withProps(props).withParams().withReferrer().withSetCookies().withRedirect(LOGIN_PAGE).withNoELP().withAuthParams();
  ltci.initialize(ici);
  assertEquals("String_Node_Str",expect,ltci.intercept(icm));
}
Program: 34870
Project: 34870
Buggy source:
/** 
 * valid method. valid objects. Make sure that AuthenticationStatus.SUCCESS is returned along with redirection to the original url.
 */
@Test public void testInterceptContinueFormForward() throws Exception {
  isInterceptedMethod=true;
  ltci.setMPP(mpp);
  Properties props=new Properties();
  props.put(JavaEESecConstants.LOGIN_TO_CONTINUE_LOGINPAGE,LOGIN_PAGE);
  props.put(JavaEESecConstants.LOGIN_TO_CONTINUE_ERRORPAGE,ERROR_PAGE);
  props.put(JavaEESecConstants.LOGIN_TO_CONTINUE_USEFORWARDTOLOGIN,Boolean.TRUE);
  Object expect=AuthenticationStatus.SEND_CONTINUE;
  String storedReq="String_Node_Str";
  String requestUrl="String_Node_Str";
  withInvocationContext(expect).withProps(props).withParams().withReferrer().withSetCookies().withForward(LOGIN_PAGE).withNoELP();
  ltci.initialize(ici);
  assertEquals("String_Node_Str",expect,ltci.intercept(icm));
}

Fixed version (ground truth):
/** 
 * valid method. valid objects. Make sure that AuthenticationStatus.SUCCESS is returned along with redirection to the original url.
 */
@Test public void testInterceptContinueFormForward() throws Exception {
  isInterceptedMethod=true;
  ltci.setMPP(mpp);
  Properties props=new Properties();
  props.put(JavaEESecConstants.LOGIN_TO_CONTINUE_LOGINPAGE,LOGIN_PAGE);
  props.put(JavaEESecConstants.LOGIN_TO_CONTINUE_ERRORPAGE,ERROR_PAGE);
  props.put(JavaEESecConstants.LOGIN_TO_CONTINUE_USEFORWARDTOLOGIN,Boolean.TRUE);
  Object expect=AuthenticationStatus.SEND_CONTINUE;
  String storedReq="String_Node_Str";
  String requestUrl="String_Node_Str";
  withInvocationContext(expect).withProps(props).withParams().withReferrer().withSetCookies().withForward(LOGIN_PAGE).withNoELP().withAuthParams();
  ltci.initialize(ici);
  assertEquals("String_Node_Str",expect,ltci.intercept(icm));
}