nus-yam/ex-repair huggingface dataset:
Program: 34779
Project: 34779
Buggy source:
@BeforeClass public static void setup() throws Exception {
  bootstrap=Bootstrap.getInstance();
  machine=LibertyServerUtils.createMachine(bootstrap);
  previousWorkDir=machine.getWorkDir();
  machine.setWorkDir(null);
  installPath=LibertyFileManager.getInstallPath(bootstrap);
  defaultServerPath=installPath + "String_Node_Str" + defaultServerName;
}

Fixed version (ground truth):
@BeforeClass public static void setup() throws Exception {
  bootstrap=Bootstrap.getInstance();
  machine=LibertyServerUtils.createMachine(bootstrap);
  previousWorkDir=machine.getWorkDir();
  machine.setWorkDir(null);
  installPath=LibertyFileManager.getInstallPath(bootstrap);
  defaultServerPath=installPath + "String_Node_Str" + defaultServerName;
  bootstrap.setValue("String_Node_Str",installPath);
}
Program: 34784
Project: 34784
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.getId());
  }
  closeTable.put(streamProcessor.getId(),streamProcessor);
  streamTable.remove(streamProcessor.getId());
}

Fixed version (ground truth):
/** 
 * Set a stream as closed on this link: remove it from the open streams table and move it to the closed streams table If the stream is even (locally opened), decrement the number of open push streams
 * @param streamProcessor
 */
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());
  if (streamProcessor.getId() % 2 == 0) {
synchronized (pushSync) {
      this.openPushStreams--;
    }
  }
}
Program: 34785
Project: 34785
Buggy source:
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;
}

Fixed version (ground truth):
/** 
 * Create a new stream and add it to this link. If the stream ID is even, check to make sure this link has not exceeded the maximum number of concurrent streams (as set by the client); if too many streams are open, don't open a new one.
 * @param streamID
 * @return null if creating this stream would exceed the maximum number locally-opened streams
 */
public H2StreamProcessor createNewInboundLink(Integer streamID){
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + streamID);
  }
  if ((streamID % 2 == 0) && (streamID != 0)) {
synchronized (pushSync) {
      if (openPushStreams > this.getConnectionSettings().getMaxConcurrentStreams()) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
          Tr.debug(tc,"String_Node_Str" + openPushStreams);
        }
        return null;
      }
      openPushStreams++;
    }
  }
  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);
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + streamID + "String_Node_Str"+ stream);
  }
  return stream;
}
Program: 34787
Project: 34787
Buggy source:
public void sendRequestToWc(FrameHeaders frame){
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.entry(tc,"String_Node_Str");
  }
  if (null == frame) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str");
    }
  }
 else {
    WsByteBufferPoolManager bufManager=HttpDispatcher.getBufferManager();
    WsByteBuffer buf=bufManager.allocate(frame.buildFrameForWrite().length);
    byte[] ba=frame.buildFrameForWrite();
    buf.put(ba);
    buf.flip();
    TCPReadRequestContext readi=h2HttpInboundLinkWrap.getConnectionContext().getReadInterface();
    readi.setBuffer(buf);
    currentFrame=frame;
    this.getHeadersFromFrame();
    setHeadersComplete();
    try {
      processCompleteHeaders();
    }
 catch (    CompressionException e) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
        Tr.debug(tc,"String_Node_Str" + myID);
      }
      buf.release();
      this.currentFrame=null;
      h2HttpInboundLinkWrap.muxLink.streamTable.remove(this);
      return;
    }
    setReadyForRead();
  }
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.exit(tc,"String_Node_Str");
  }
}

Fixed version (ground truth):
public void sendRequestToWc(FrameHeaders frame){
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.entry(tc,"String_Node_Str");
  }
  if (null == frame) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str");
    }
  }
 else {
    WsByteBufferPoolManager bufManager=HttpDispatcher.getBufferManager();
    WsByteBuffer buf=bufManager.allocate(frame.buildFrameForWrite().length);
    byte[] ba=frame.buildFrameForWrite();
    buf.put(ba);
    buf.flip();
    TCPReadRequestContext readi=h2HttpInboundLinkWrap.getConnectionContext().getReadInterface();
    readi.setBuffer(buf);
    currentFrame=frame;
    this.getHeadersFromFrame();
    setHeadersComplete();
    try {
      processCompleteHeaders(true);
    }
 catch (    CompressionException e) {
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
        Tr.debug(tc,"String_Node_Str" + myID + "String_Node_Str"+ e);
      }
      buf.release();
      this.currentFrame=null;
      h2HttpInboundLinkWrap.muxLink.streamTable.remove(this);
      return;
    }
    setReadyForRead();
  }
  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
    Tr.exit(tc,"String_Node_Str");
  }
}
Program: 34788
Project: 34788
Buggy source:
/** 
 * @param direction
 * @throws CompressionException
 */
private void processHalfClosedRemote(Constants.Direction direction) throws FlowControlException, CompressionException {
  if (direction == Direction.WRITING_OUT) {
    boolean writeCompleted=writeFrameSync();
    if ((currentFrame.getFrameType() == FrameTypes.RST_STREAM || currentFrame.flagEndStreamSet()) && writeCompleted) {
      endStream=true;
      muxLink.triggerStreamClose(this);
      updateStreamState(StreamState.CLOSED);
    }
 else     if (frameType == FrameTypes.HEADERS || frameType == FrameTypes.CONTINUATION) {
      if (currentFrame.flagEndHeadersSet()) {
        setContinuationFrameExpected(false);
      }
 else {
        setContinuationFrameExpected(true);
      }
    }
  }
 else   if (currentFrame.getFrameType() == FrameTypes.RST_STREAM) {
    endStream=true;
    updateStreamState(StreamState.CLOSED);
  }
 else   if (frameType == FrameTypes.CONTINUATION) {
    getHeadersFromFrame();
    if (currentFrame.flagEndHeadersSet()) {
      processCompleteHeaders();
      setHeadersComplete();
      setReadyForRead();
    }
  }
}

Fixed version (ground truth):
/** 
 * @param direction
 * @throws CompressionException
 */
private void processHalfClosedRemote(Constants.Direction direction) throws FlowControlException, CompressionException {
  if (direction == Direction.WRITING_OUT) {
    boolean writeCompleted=writeFrameSync();
    if ((currentFrame.getFrameType() == FrameTypes.RST_STREAM || currentFrame.flagEndStreamSet()) && writeCompleted) {
      endStream=true;
      muxLink.triggerStreamClose(this);
      updateStreamState(StreamState.CLOSED);
    }
 else     if (frameType == FrameTypes.HEADERS || frameType == FrameTypes.CONTINUATION) {
      if (currentFrame.flagEndHeadersSet()) {
        setContinuationFrameExpected(false);
      }
 else {
        setContinuationFrameExpected(true);
      }
    }
  }
 else   if (currentFrame.getFrameType() == FrameTypes.RST_STREAM) {
    endStream=true;
    updateStreamState(StreamState.CLOSED);
  }
 else   if (frameType == FrameTypes.CONTINUATION) {
    getHeadersFromFrame();
    if (currentFrame.flagEndHeadersSet()) {
      processCompleteHeaders(false);
      setHeadersComplete();
      setReadyForRead();
    }
  }
}
Program: 34790
Project: 34790
Buggy source:
/** 
 * Perform operations to transition into IDLE state
 * @param direction
 * @throws CompressionException
 * @throws FlowControlException
 * @throws ProtocolException
 */
private void processIdle(Constants.Direction direction) throws CompressionException, FlowControlException, ProtocolException {
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + myID);
  }
  if (currentFrame.getFrameType() == FrameTypes.HEADERS || currentFrame.getFrameType() == FrameTypes.PUSH_PROMISE) {
    muxLink.updateHighestStreamId(myID);
  }
  if (direction == Constants.Direction.READ_IN) {
    if (frameType == FrameTypes.HEADERS) {
      processHeadersPriority();
      getHeadersFromFrame();
      if (currentFrame.flagEndHeadersSet()) {
        processCompleteHeaders();
        setHeadersComplete();
      }
 else {
        setContinuationFrameExpected(true);
      }
      if (currentFrame.flagEndStreamSet()) {
        endStream=true;
        updateStreamState(StreamState.HALF_CLOSED_REMOTE);
        if (currentFrame.flagEndHeadersSet()) {
          setReadyForRead();
        }
      }
 else {
        updateStreamState(StreamState.OPEN);
      }
    }
  }
 else {
    if (frameType == FrameTypes.HEADERS) {
      updateStreamState(StreamState.OPEN);
      if (!currentFrame.flagEndHeadersSet()) {
        setContinuationFrameExpected(true);
      }
    }
    writeFrameSync();
  }
}

Fixed version (ground truth):
/** 
 * Perform operations to transition into IDLE state
 * @param direction
 * @throws CompressionException
 * @throws FlowControlException
 * @throws ProtocolException
 */
private void processIdle(Constants.Direction direction) throws CompressionException, FlowControlException, ProtocolException {
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + myID);
  }
  if (currentFrame.getFrameType() == FrameTypes.HEADERS || currentFrame.getFrameType() == FrameTypes.PUSH_PROMISE) {
    muxLink.updateHighestStreamId(myID);
  }
  if (direction == Constants.Direction.READ_IN) {
    if (frameType == FrameTypes.HEADERS) {
      processHeadersPriority();
      getHeadersFromFrame();
      if (currentFrame.flagEndHeadersSet()) {
        processCompleteHeaders(false);
        setHeadersComplete();
      }
 else {
        setContinuationFrameExpected(true);
      }
      if (currentFrame.flagEndStreamSet()) {
        endStream=true;
        updateStreamState(StreamState.HALF_CLOSED_REMOTE);
        if (currentFrame.flagEndHeadersSet()) {
          setReadyForRead();
        }
      }
 else {
        updateStreamState(StreamState.OPEN);
      }
    }
  }
 else {
    if (frameType == FrameTypes.HEADERS) {
      updateStreamState(StreamState.OPEN);
      if (!currentFrame.flagEndHeadersSet()) {
        setContinuationFrameExpected(true);
      }
    }
    writeFrameSync();
  }
}
Program: 34791
Project: 34791
Buggy source:
@Override public String toString(){
  StringBuilder frameToString=new StringBuilder();
  frameToString.append(super.toString());
  frameToString.append("String_Node_Str" + this.getEnablePush() + "String_Node_Str");
  frameToString.append("String_Node_Str" + this.getHeaderTableSize() + "String_Node_Str");
  frameToString.append("String_Node_Str" + this.getInitialWindowSize() + "String_Node_Str");
  frameToString.append("String_Node_Str" + this.getMaxHeaderListSize() + "String_Node_Str");
  frameToString.append("String_Node_Str" + this.getMaxFrameSize() + "String_Node_Str");
  frameToString.append("String_Node_Str" + this.getMaxHeaderListSize() + "String_Node_Str");
  return frameToString.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder frameToString=new StringBuilder();
  frameToString.append(super.toString());
  frameToString.append("String_Node_Str" + this.getEnablePush() + "String_Node_Str");
  frameToString.append("String_Node_Str" + this.getHeaderTableSize() + "String_Node_Str");
  frameToString.append("String_Node_Str" + this.getInitialWindowSize() + "String_Node_Str");
  frameToString.append("String_Node_Str" + this.getMaxFrameSize() + "String_Node_Str");
  frameToString.append("String_Node_Str" + this.getMaxHeaderListSize() + "String_Node_Str");
  frameToString.append("String_Node_Str" + this.getMaxConcurrentStreams() + "String_Node_Str");
  return frameToString.toString();
}
Program: 34796
Project: 34796
Buggy source:
@Override public AuthStatus validateRequest(MessageInfo messageInfo,Subject clientSubject,Subject serviceSubject) throws AuthException {
  AuthStatus status=AuthStatus.SEND_FAILURE;
  try {
    HttpAuthenticationMechanism authMech=getModulePropertiesUtils().getHttpAuthenticationMechanism();
    HttpMessageContext httpMessageContext=createHttpMessageContext(messageInfo,clientSubject);
    AuthenticationStatus authenticationStatus=authMech.validateRequest((HttpServletRequest)messageInfo.getRequestMessage(),(HttpServletResponse)messageInfo.getResponseMessage(),httpMessageContext);
    status=translateValidateRequestStatus(authenticationStatus);
    registerSession(httpMessageContext);
  }
 catch (  Exception e) {
    e.printStackTrace();
    AuthException authException=new AuthException();
    authException.initCause(e);
    throw authException;
  }
  return status;
}

Fixed version (ground truth):
@Override public AuthStatus validateRequest(MessageInfo messageInfo,Subject clientSubject,Subject serviceSubject) throws AuthException {
  AuthStatus status=AuthStatus.SEND_FAILURE;
  try {
    HttpAuthenticationMechanism authMech=getModulePropertiesUtils().getHttpAuthenticationMechanism();
    HttpMessageContext httpMessageContext=createHttpMessageContext(messageInfo,clientSubject);
    AuthenticationStatus authenticationStatus=authMech.validateRequest((HttpServletRequest)messageInfo.getRequestMessage(),(HttpServletResponse)messageInfo.getResponseMessage(),httpMessageContext);
    status=translateValidateRequestStatus(authenticationStatus);
    registerSession(httpMessageContext);
  }
 catch (  Exception e) {
    e.printStackTrace();
    AuthException authException=new AuthException(e.getMessage());
    authException.initCause(e);
    throw authException;
  }
  return status;
}
Program: 34797
Project: 34797
Buggy source:
public WebReply createReplyForAuthnFailure(AuthenticationResult authResult,String realm){
  WebReply reply=null;
switch (authResult.getStatus()) {
case FAILURE:
    return DENY_AUTHN_FAILED;
case SEND_401:
  return new ChallengeReply(realm);
case TAI_CHALLENGE:
return new TAIChallengeReply(authResult.getTAIChallengeCode());
case REDIRECT:
return new RedirectReply(authResult.getRedirectURL(),authResult.getCookies());
case UNKNOWN:
case CONTINUE:
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc,"String_Node_Str" + authResult.getStatus() + "String_Node_Str"+ authResult.getReason()+ "String_Node_Str");
}
return DENY_AUTHN_FAILED;
default :
break;
}
return reply;
}

Fixed version (ground truth):
public WebReply createReplyForAuthnFailure(AuthenticationResult authResult,String realm){
  WebReply reply=null;
switch (authResult.getStatus()) {
case FAILURE:
    String reason=authResult.getReason();
  if (reason != null && reason.contains("String_Node_Str"))   return new DenyReply(reason);
return DENY_AUTHN_FAILED;
case SEND_401:
return new ChallengeReply(realm);
case TAI_CHALLENGE:
return new TAIChallengeReply(authResult.getTAIChallengeCode());
case REDIRECT:
return new RedirectReply(authResult.getRedirectURL(),authResult.getCookies());
case UNKNOWN:
case CONTINUE:
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc,"String_Node_Str" + authResult.getStatus() + "String_Node_Str"+ authResult.getReason()+ "String_Node_Str");
}
return DENY_AUTHN_FAILED;
default :
break;
}
return reply;
}
Program: 34799
Project: 34799
Buggy source:
@After public void after() throws Exception {
  server.stopServer();
}

Fixed version (ground truth):
@After public void after() throws Exception {
  if (server.isStarted()) {
    server.stopServer();
  }
}
Program: 34800
Project: 34800
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public void validate(ValidationHelper helper,Context context,String key,Header t){
  String reference=t.getRef();
  if (reference != null && !reference.isEmpty()) {
    ValidatorUtils.referenceValidatorHelper(reference,t,helper,context,key);
    return;
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public void validate(ValidationHelper helper,Context context,String key,Header t){
  if (t != null) {
    String reference=t.getRef();
    if (reference != null && !reference.isEmpty()) {
      ValidatorUtils.referenceValidatorHelper(reference,t,helper,context,key);
      return;
    }
  }
}
Program: 34801
Project: 34801
Buggy source:
@Test public void missingPathCallBack(){
  CallbackImpl c=new CallbackImpl();
  c.addPathItem("String_Node_Str",null);
  vh.resetResults();
  validator.validate(vh,null,c);
  Assert.assertEquals("String_Node_Str" + vh,1,vh.getEventsSize());
  String message=vh.getResult().getEvents().get(0).message;
  if (!message.contains("String_Node_Str"))   Assert.fail("String_Node_Str" + vh);
}

Fixed version (ground truth):
@Test public void missingPathCallBack(){
  CallbackImpl c=new CallbackImpl();
  c.addPathItem("String_Node_Str",null);
  vh.resetResults();
  validator.validate(vh,context,c);
  Assert.assertEquals("String_Node_Str" + vh,1,vh.getEventsSize());
  String message=vh.getResult().getEvents().get(0).message;
  if (!message.contains("String_Node_Str"))   Assert.fail("String_Node_Str" + vh);
}
Program: 34802
Project: 34802
Buggy source:
@Test public void complexCallBack(){
  CallbackImpl c=new CallbackImpl();
  c.addPathItem("String_Node_Str",pathItem);
  c.addPathItem("String_Node_Str",pathItem);
  c.addPathItem("String_Node_Str",pathItem);
  vh.resetResults();
  validator.validate(vh,null,c);
  if (vh.hasEvents())   Assert.fail("String_Node_Str" + vh);
}

Fixed version (ground truth):
@Test public void complexCallBack(){
  CallbackImpl c=new CallbackImpl();
  c.addPathItem("String_Node_Str",pathItem);
  c.addPathItem("String_Node_Str",pathItem);
  c.addPathItem("String_Node_Str",pathItem);
  vh.resetResults();
  validator.validate(vh,context,c);
  if (vh.hasEvents())   Assert.fail("String_Node_Str" + vh);
}
Program: 34803
Project: 34803
Buggy source:
@Test public void invalidRuntimeExpressionCallBack(){
  CallbackImpl c=new CallbackImpl();
  c.addPathItem("String_Node_Str",pathItem);
  c.addPathItem("String_Node_Str",pathItem);
  vh.resetResults();
  validator.validate(vh,null,c);
  Assert.assertEquals("String_Node_Str" + vh,1,vh.getEventsSize());
  String message=vh.getResult().getEvents().get(0).message;
  if (!message.contains("String_Node_Str"))   Assert.fail("String_Node_Str" + vh);
}

Fixed version (ground truth):
@Test public void invalidRuntimeExpressionCallBack(){
  CallbackImpl c=new CallbackImpl();
  c.addPathItem("String_Node_Str",pathItem);
  c.addPathItem("String_Node_Str",pathItem);
  vh.resetResults();
  validator.validate(vh,context,c);
  Assert.assertEquals("String_Node_Str" + vh,1,vh.getEventsSize());
  String message=vh.getResult().getEvents().get(0).message;
  if (!message.contains("String_Node_Str"))   Assert.fail("String_Node_Str" + vh);
}
Program: 34804
Project: 34804
Buggy source:
@Test public void simpleCallBack(){
  CallbackImpl c=new CallbackImpl();
  c.addPathItem("String_Node_Str",pathItem);
  vh.resetResults();
  validator.validate(vh,null,c);
  if (vh.hasEvents())   Assert.fail("String_Node_Str" + vh);
}

Fixed version (ground truth):
@Test public void simpleCallBack(){
  CallbackImpl c=new CallbackImpl();
  c.addPathItem("String_Node_Str",pathItem);
  vh.resetResults();
  validator.validate(vh,context,c);
  if (vh.hasEvents())   Assert.fail("String_Node_Str" + vh);
}
Program: 34805
Project: 34805
Buggy source:
@Test public void emptyCallBack(){
  CallbackImpl c=new CallbackImpl();
  c.addPathItem("String_Node_Str",pathItem);
  vh.resetResults();
  validator.validate(vh,null,c);
  Assert.assertEquals("String_Node_Str" + vh,1,vh.getEventsSize());
  String message=vh.getResult().getEvents().get(0).message;
  if (!message.contains("String_Node_Str"))   Assert.fail("String_Node_Str" + vh);
}

Fixed version (ground truth):
@Test public void emptyCallBack(){
  CallbackImpl c=new CallbackImpl();
  c.addPathItem("String_Node_Str",pathItem);
  vh.resetResults();
  validator.validate(vh,context,c);
  Assert.assertEquals("String_Node_Str" + vh,1,vh.getEventsSize());
  String message=vh.getResult().getEvents().get(0).message;
  if (!message.contains("String_Node_Str"))   Assert.fail("String_Node_Str" + vh);
}
Program: 34806
Project: 34806
Buggy source:
@Test public void invalidUrlCallBack(){
  CallbackImpl c=new CallbackImpl();
  c.addPathItem("String_Node_Str",pathItem);
  vh.resetResults();
  validator.validate(vh,null,c);
  Assert.assertEquals("String_Node_Str" + vh,1,vh.getEventsSize());
  String message=vh.getResult().getEvents().get(0).message;
  if (!message.contains("String_Node_Str"))   Assert.fail("String_Node_Str" + vh);
}

Fixed version (ground truth):
@Test public void invalidUrlCallBack(){
  CallbackImpl c=new CallbackImpl();
  c.addPathItem("String_Node_Str",pathItem);
  vh.resetResults();
  validator.validate(vh,context,c);
  Assert.assertEquals("String_Node_Str" + vh,1,vh.getEventsSize());
  String message=vh.getResult().getEvents().get(0).message;
  if (!message.contains("String_Node_Str"))   Assert.fail("String_Node_Str" + vh);
}
Program: 34807
Project: 34807
Buggy source:
@Test public void invalidTemplateCallBack(){
  CallbackImpl c=new CallbackImpl();
  c.addPathItem("String_Node_Str",pathItem);
  c.addPathItem("String_Node_Str",pathItem);
  vh.resetResults();
  validator.validate(vh,null,c);
  Assert.assertEquals("String_Node_Str" + vh,1,vh.getEventsSize());
  String message=vh.getResult().getEvents().get(0).message;
  if (!message.contains("String_Node_Str"))   Assert.fail("String_Node_Str" + vh);
}

Fixed version (ground truth):
@Test public void invalidTemplateCallBack(){
  CallbackImpl c=new CallbackImpl();
  c.addPathItem("String_Node_Str",pathItem);
  c.addPathItem("String_Node_Str",pathItem);
  vh.resetResults();
  validator.validate(vh,context,c);
  Assert.assertEquals("String_Node_Str" + vh,1,vh.getEventsSize());
  String message=vh.getResult().getEvents().get(0).message;
  if (!message.contains("String_Node_Str"))   Assert.fail("String_Node_Str" + vh);
}
Program: 34808
Project: 34808
Buggy source:
@Test public void testValidMediaTypeValidator(){
  EncodingImpl encoding=new EncodingImpl();
  encoding.setContentType("String_Node_Str");
  Map<String,Encoding> encodingMap=new HashMap<String,Encoding>();
  encodingMap.put("String_Node_Str",encoding);
  mediaType.setEncoding(encodingMap);
  validator.validate(validationHelper,null,mediaType);
  Assert.assertEquals(0,validationHelper.getEventsSize());
}

Fixed version (ground truth):
@Test public void testValidMediaTypeValidator(){
  EncodingImpl encoding=new EncodingImpl();
  encoding.setContentType("String_Node_Str");
  Map<String,Encoding> encodingMap=new HashMap<String,Encoding>();
  encodingMap.put("String_Node_Str",encoding);
  mediaType.setEncoding(encodingMap);
  validator.validate(validationHelper,context,mediaType);
  Assert.assertEquals(0,validationHelper.getEventsSize());
}
Program: 34809
Project: 34809
Buggy source:
@Test public void testEmptySchemaInvalidEncodingMediaTypeValidator(){
  mediaType.setSchema(new SchemaImpl());
  EncodingImpl encoding=new EncodingImpl();
  encoding.setContentType("String_Node_Str");
  Map<String,Encoding> encodingMap=new HashMap<String,Encoding>();
  encodingMap.put("String_Node_Str",encoding);
  mediaType.setEncoding(encodingMap);
  validator.validate(validationHelper,null,mediaType);
  Assert.assertEquals(1,validationHelper.getEventsSize());
}

Fixed version (ground truth):
@Test public void testEmptySchemaInvalidEncodingMediaTypeValidator(){
  mediaType.setSchema(new SchemaImpl());
  EncodingImpl encoding=new EncodingImpl();
  encoding.setContentType("String_Node_Str");
  Map<String,Encoding> encodingMap=new HashMap<String,Encoding>();
  encodingMap.put("String_Node_Str",encoding);
  mediaType.setEncoding(encodingMap);
  validator.validate(validationHelper,context,mediaType);
  Assert.assertEquals(1,validationHelper.getEventsSize());
}
Program: 34810
Project: 34810
Buggy source:
@Test public void testInvalidExampleMediaTypeValidator(){
  EncodingImpl encoding=new EncodingImpl();
  encoding.setContentType("String_Node_Str");
  Map<String,Encoding> encodingMap=new HashMap<String,Encoding>();
  encodingMap.put("String_Node_Str",encoding);
  mediaType.setEncoding(encodingMap);
  mediaType.setExample("String_Node_Str");
  Map<String,ExampleImpl> examples=new HashMap<String,ExampleImpl>();
  examples.put("String_Node_Str",new ExampleImpl());
  mediaType.setExample(examples);
  validator.validate(validationHelper,null,mediaType);
  Assert.assertEquals(1,validationHelper.getEventsSize());
}

Fixed version (ground truth):
@Test public void testInvalidExampleMediaTypeValidator(){
  EncodingImpl encoding=new EncodingImpl();
  encoding.setContentType("String_Node_Str");
  Map<String,Encoding> encodingMap=new HashMap<String,Encoding>();
  encodingMap.put("String_Node_Str",encoding);
  mediaType.setEncoding(encodingMap);
  mediaType.setExample("String_Node_Str");
  Map<String,ExampleImpl> examples=new HashMap<String,ExampleImpl>();
  examples.put("String_Node_Str",new ExampleImpl());
  mediaType.setExample(examples);
  validator.validate(validationHelper,context,mediaType);
  Assert.assertEquals(1,validationHelper.getEventsSize());
}
Program: 34811
Project: 34811
Buggy source:
@Test public void testNullSchemaInvalidEncodingMediaTypeValidator(){
  mediaType.setSchema(null);
  EncodingImpl encoding=new EncodingImpl();
  encoding.setContentType("String_Node_Str");
  Map<String,Encoding> encodingMap=new HashMap<String,Encoding>();
  encodingMap.put("String_Node_Str",encoding);
  mediaType.setEncoding(encodingMap);
  validator.validate(validationHelper,null,mediaType);
  Assert.assertEquals(1,validationHelper.getEventsSize());
}

Fixed version (ground truth):
@Test public void testNullSchemaInvalidEncodingMediaTypeValidator(){
  mediaType.setSchema(null);
  EncodingImpl encoding=new EncodingImpl();
  encoding.setContentType("String_Node_Str");
  Map<String,Encoding> encodingMap=new HashMap<String,Encoding>();
  encodingMap.put("String_Node_Str",encoding);
  mediaType.setEncoding(encodingMap);
  validator.validate(validationHelper,context,mediaType);
  Assert.assertEquals(1,validationHelper.getEventsSize());
}
Program: 34812
Project: 34812
Buggy source:
@Test public void testInvalidEncodingMediaTypeValidator(){
  EncodingImpl encoding=new EncodingImpl();
  encoding.setContentType("String_Node_Str");
  Map<String,Encoding> encodingMap=new HashMap<String,Encoding>();
  encodingMap.put("String_Node_Str",encoding);
  mediaType.setEncoding(encodingMap);
  validator.validate(validationHelper,null,mediaType);
  Assert.assertEquals(1,validationHelper.getEventsSize());
}

Fixed version (ground truth):
@Test public void testInvalidEncodingMediaTypeValidator(){
  EncodingImpl encoding=new EncodingImpl();
  encoding.setContentType("String_Node_Str");
  Map<String,Encoding> encodingMap=new HashMap<String,Encoding>();
  encodingMap.put("String_Node_Str",encoding);
  mediaType.setEncoding(encodingMap);
  validator.validate(validationHelper,context,mediaType);
  Assert.assertEquals(1,validationHelper.getEventsSize());
}
Program: 34813
Project: 34813
Buggy source:
@Test public void testValidExamplesMediaTypeValidator(){
  Map<String,ExampleImpl> examples=new HashMap<String,ExampleImpl>();
  examples.put("String_Node_Str",new ExampleImpl());
  mediaType.setExample(examples);
  validator.validate(validationHelper,null,mediaType);
  Assert.assertEquals(0,validationHelper.getEventsSize());
}

Fixed version (ground truth):
@Test public void testValidExamplesMediaTypeValidator(){
  Map<String,ExampleImpl> examples=new HashMap<String,ExampleImpl>();
  examples.put("String_Node_Str",new ExampleImpl());
  mediaType.setExample(examples);
  validator.validate(validationHelper,context,mediaType);
  Assert.assertEquals(0,validationHelper.getEventsSize());
}
Program: 34814
Project: 34814
Buggy source:
@Test public void testEmptySchemaMediaTypeValidator(){
  mediaType.setSchema(null);
  validator.validate(validationHelper,null,mediaType);
  Assert.assertEquals(0,validationHelper.getEventsSize());
}

Fixed version (ground truth):
@Test public void testEmptySchemaMediaTypeValidator(){
  mediaType.setSchema(null);
  validator.validate(validationHelper,context,mediaType);
  Assert.assertEquals(0,validationHelper.getEventsSize());
}
Program: 34815
Project: 34815
Buggy source:
@Test public void testValidExampleMediaTypeValidator(){
  mediaType.setExample("String_Node_Str");
  validator.validate(validationHelper,null,mediaType);
  Assert.assertEquals(0,validationHelper.getEventsSize());
}

Fixed version (ground truth):
@Test public void testValidExampleMediaTypeValidator(){
  mediaType.setExample("String_Node_Str");
  validator.validate(validationHelper,context,mediaType);
  Assert.assertEquals(0,validationHelper.getEventsSize());
}
Program: 34816
Project: 34816
Buggy source:
@Test public void testOpenAPIValidator(){
  OpenAPIValidator validator=OpenAPIValidator.getInstance();
  TestValidationHelper vh=new TestValidationHelper();
  OpenAPIImpl openapi=new OpenAPIImpl();
  openapi.setOpenapi(null);
  validator.validate(vh,null,openapi);
  Assert.assertEquals(3,vh.getEventsSize());
  vh.resetResults();
  openapi.setOpenapi("String_Node_Str");
  validator.validate(vh,null,openapi);
  Assert.assertEquals(3,vh.getEventsSize());
  vh.resetResults();
  openapi.setOpenapi("String_Node_Str");
  openapi.setInfo(new InfoImpl());
  openapi.setPaths(new PathsImpl().addPathItem("String_Node_Str",new PathItemImpl()));
  validator.validate(vh,null,openapi);
  Assert.assertFalse(vh.hasEvents());
}

Fixed version (ground truth):
@Test public void testOpenAPIValidator(){
  OpenAPIValidator validator=OpenAPIValidator.getInstance();
  TestValidationHelper vh=new TestValidationHelper();
  OpenAPIImpl openapi=new OpenAPIImpl();
  openapi.setOpenapi(null);
  validator.validate(vh,context,openapi);
  Assert.assertEquals(3,vh.getEventsSize());
  vh.resetResults();
  openapi.setOpenapi("String_Node_Str");
  validator.validate(vh,context,openapi);
  Assert.assertEquals(3,vh.getEventsSize());
  vh.resetResults();
  openapi.setOpenapi("String_Node_Str");
  openapi.setInfo(new InfoImpl());
  openapi.setPaths(new PathsImpl().addPathItem("String_Node_Str",new PathItemImpl()));
  validator.validate(vh,context,openapi);
  Assert.assertFalse(vh.hasEvents());
}
Program: 34817
Project: 34817
Buggy source:
@Test public void testRequestBodyValidator(){
  RequestBodyValidator validator=RequestBodyValidator.getInstance();
  TestValidationHelper validationHelper=new TestValidationHelper();
  RequestBodyImpl requestBody=new RequestBodyImpl();
  validator.validate(validationHelper,null,requestBody);
  Assert.assertEquals(1,validationHelper.getEventsSize());
  validationHelper.resetResults();
  requestBody.setContent(new ContentImpl());
  validator.validate(validationHelper,null,requestBody);
  Assert.assertEquals(1,validationHelper.getEventsSize());
  validationHelper.resetResults();
  ContentImpl content=new ContentImpl();
  content.addMediaType("String_Node_Str",new MediaTypeImpl());
  requestBody.setContent(content);
  validator.validate(validationHelper,null,requestBody);
  Assert.assertEquals(0,validationHelper.getEventsSize());
}

Fixed version (ground truth):
@Test public void testRequestBodyValidator(){
  RequestBodyValidator validator=RequestBodyValidator.getInstance();
  TestValidationHelper validationHelper=new TestValidationHelper();
  RequestBodyImpl requestBody=new RequestBodyImpl();
  validator.validate(validationHelper,context,requestBody);
  Assert.assertEquals(1,validationHelper.getEventsSize());
  validationHelper.resetResults();
  requestBody.setContent(new ContentImpl());
  validator.validate(validationHelper,context,requestBody);
  Assert.assertEquals(1,validationHelper.getEventsSize());
  validationHelper.resetResults();
  ContentImpl content=new ContentImpl();
  content.addMediaType("String_Node_Str",new MediaTypeImpl());
  requestBody.setContent(content);
  validator.validate(validationHelper,context,requestBody);
  Assert.assertEquals(0,validationHelper.getEventsSize());
}
Program: 34818
Project: 34818
Buggy source:
@Test public void testHelloAppClientWithEnterpriseApplication() throws Exception {
  client.copyFileToLibertyClientRoot("String_Node_Str");
  String appClientMsg="String_Node_Str";
  startProcess();
  assertStartMessages();
  assertAppMessage(appClientMsg);
}

Fixed version (ground truth):
@Test public void testHelloAppClientWithEnterpriseApplication() throws Exception {
  ShrinkHelper.exportAppToClient(client,earHAC);
  String appClientMsg="String_Node_Str";
  client.startClient();
  assertAppMessage(appClientMsg);
}
Program: 34819
Project: 34819
Buggy source:
@Test public void testHelloAppClient() throws Exception {
  client.copyFileToLibertyClientRoot("String_Node_Str");
  String cbhPostConstructMsg="String_Node_Str";
  String mainPostConstructMsg="String_Node_Str";
  String cbhPreDestroyMsg="String_Node_Str";
  String appClientMsg="String_Node_Str";
  startProcess();
  assertStartMessages();
  assertAppMessage(cbhPostConstructMsg);
  assertAppMessage(mainPostConstructMsg);
  assertAppMessage(appClientMsg);
  assertAppMessage(cbhPreDestroyMsg);
}

Fixed version (ground truth):
@Test public void testHelloAppClient() throws Exception {
  ShrinkHelper.exportAppToClient(client,earHAC);
  String cbhPostConstructMsg="String_Node_Str";
  String mainPostConstructMsg="String_Node_Str";
  String cbhPreDestroyMsg="String_Node_Str";
  String appClientMsg="String_Node_Str";
  client.startClient();
  assertAppMessage(cbhPostConstructMsg);
  assertAppMessage(mainPostConstructMsg);
  assertAppMessage(appClientMsg);
  assertAppMessage(cbhPreDestroyMsg);
}
Program: 34820
Project: 34820
Buggy source:
@Test public void testSystemExitFromClientMainWithNoDD() throws Exception {
  client.copyFileToLibertyClientRoot("String_Node_Str");
  ProgramOutput po=startProcess();
  System.out.println("String_Node_Str" + po.getStdout());
  System.out.println("String_Node_Str" + po.getStderr());
  assertStartMessages();
  assertAppMessage("String_Node_Str");
  assertNotAppMessage("String_Node_Str");
  assertAppMessage("String_Node_Str");
  assertNotAppMessage("String_Node_Str");
}

Fixed version (ground truth):
@Test public void testSystemExitFromClientMainWithNoDD() throws Exception {
  String APP_NAME="String_Node_Str";
  JavaArchive jar=ShrinkHelper.buildJavaArchive(APP_NAME + "String_Node_Str","String_Node_Str");
  EnterpriseArchive app=ShrinkWrap.create(EnterpriseArchive.class,APP_NAME + "String_Node_Str").addAsModule(jar).addAsManifestResource(new File("String_Node_Str" + APP_NAME + "String_Node_Str"));
  ShrinkHelper.exportAppToClient(client,app);
  client.startClient();
  assertAppMessage("String_Node_Str");
  assertNotAppMessage("String_Node_Str");
  assertAppMessage("String_Node_Str");
  assertNotAppMessage("String_Node_Str");
}
Program: 34821
Project: 34821
Buggy source:
@Test public void testSystemExitFromClientMain() throws Exception {
  client.copyFileToLibertyClientRoot("String_Node_Str");
  ProgramOutput po=startProcess();
  System.out.println("String_Node_Str" + po.getStdout());
  System.out.println("String_Node_Str" + po.getStderr());
  assertStartMessages();
  assertAppMessage("String_Node_Str");
  assertNotAppMessage("String_Node_Str");
  assertAppMessage("String_Node_Str");
  assertNotAppMessage("String_Node_Str");
}

Fixed version (ground truth):
@Test public void testSystemExitFromClientMain() throws Exception {
  String APP_NAME="String_Node_Str";
  JavaArchive jar=ShrinkHelper.buildJavaArchive(APP_NAME + "String_Node_Str","String_Node_Str");
  EnterpriseArchive app=ShrinkWrap.create(EnterpriseArchive.class,APP_NAME + "String_Node_Str").addAsModule(jar).addAsManifestResource(new File("String_Node_Str" + APP_NAME + "String_Node_Str"));
  ShrinkHelper.exportAppToClient(client,app);
  client.startClient();
  assertAppMessage("String_Node_Str");
  assertNotAppMessage("String_Node_Str");
  assertAppMessage("String_Node_Str");
  assertNotAppMessage("String_Node_Str");
}
Program: 34822
Project: 34822
Buggy source:
@Test public void testClientConfigDir() throws Exception {
  client.copyFileToLibertyClientRoot("String_Node_Str");
  String appClientMsg="String_Node_Str";
  startProcess();
  assertStartMessages();
  assertAppMessage(appClientMsg);
}

Fixed version (ground truth):
@Test public void testClientConfigDir() throws Exception {
  ShrinkHelper.exportAppToClient(client,earHAC);
  client.startClient();
  assertAppMessage("String_Node_Str");
}
Program: 34823
Project: 34823
Buggy source:
@Test public void testCallbackHandlerNoDefaultConstructor() throws Exception {
  client.copyFileToLibertyClientRoot("String_Node_Str");
  String errorMsg="String_Node_Str";
  startProcess();
  assertAppMessage(errorMsg);
}

Fixed version (ground truth):
@Test public void testCallbackHandlerNoDefaultConstructor() throws Exception {
  String APP_NAME="String_Node_Str";
  JavaArchive jar=ShrinkHelper.buildJavaArchive(APP_NAME + "String_Node_Str","String_Node_Str");
  EnterpriseArchive app=ShrinkWrap.create(EnterpriseArchive.class,APP_NAME + "String_Node_Str").addAsModule(jar).addAsManifestResource(new File("String_Node_Str" + APP_NAME + "String_Node_Str"));
  ShrinkHelper.exportAppToClient(client,app);
  client.addIgnoreErrors("String_Node_Str","String_Node_Str" + APP_NAME,"String_Node_Str" + APP_NAME);
  client.startClient();
  assertAppMessage("String_Node_Str");
}
Program: 34824
Project: 34824
Buggy source:
@Test public void testInAppClientContainerLookup() throws Exception {
  client.copyFileToLibertyClientRoot("String_Node_Str");
  String appClientMsg="String_Node_Str";
  startProcess();
  assertStartMessages();
  assertAppMessage(appClientMsg);
}

Fixed version (ground truth):
@Test public void testInAppClientContainerLookup() throws Exception {
  String APP_NAME="String_Node_Str";
  JavaArchive jar=ShrinkHelper.buildJavaArchive(APP_NAME + "String_Node_Str","String_Node_Str");
  EnterpriseArchive app=ShrinkWrap.create(EnterpriseArchive.class,APP_NAME + "String_Node_Str").addAsModule(jar).addAsManifestResource(new File("String_Node_Str" + APP_NAME + "String_Node_Str"));
  ShrinkHelper.exportAppToClient(client,app);
  client.startClient();
  assertAppMessage("String_Node_Str");
}
Program: 34825
Project: 34825
Buggy source:
@Test public void testHelloAppClientNoClassDefFoundError() throws Exception {
  client.copyFileToLibertyClientRoot("String_Node_Str");
  String errorMsg="String_Node_Str";
  startProcess();
  assertAppMessage(errorMsg);
}

Fixed version (ground truth):
@Test public void testHelloAppClientNoClassDefFoundError() throws Exception {
  String APP_NAME="String_Node_Str";
  JavaArchive jar=ShrinkHelper.buildJavaArchive(APP_NAME + "String_Node_Str","String_Node_Str");
  EnterpriseArchive app=ShrinkWrap.create(EnterpriseArchive.class,APP_NAME + "String_Node_Str").addAsModule(jar).addAsManifestResource(new File("String_Node_Str" + APP_NAME + "String_Node_Str"));
  ShrinkHelper.exportAppToClient(client,app);
  client.addIgnoreErrors("String_Node_Str" + APP_NAME,"String_Node_Str" + APP_NAME);
  client.startClient();
  assertAppMessage("String_Node_Str");
}
Program: 34826
Project: 34826
Buggy source:
public String executeCustomFormLogin(HttpClient httpclient,String url,String username,String password,String viewState) throws Exception {
  String methodName="String_Node_Str";
  Log.info(logClass,methodName,"String_Node_Str" + url + "String_Node_Str"+ username+ "String_Node_Str"+ password+ "String_Node_Str"+ viewState);
  HttpPost postMethod=new HttpPost(url);
  List<NameValuePair> nvps=new ArrayList<NameValuePair>();
  nvps.add(new BasicNameValuePair("String_Node_Str",username));
  nvps.add(new BasicNameValuePair("String_Node_Str",password));
  nvps.add(new BasicNameValuePair("String_Node_Str","String_Node_Str"));
  nvps.add(new BasicNameValuePair("String_Node_Str","String_Node_Str"));
  if (viewState != null) {
    nvps.add(new BasicNameValuePair("String_Node_Str",viewState));
  }
  postMethod.setEntity(new UrlEncodedFormEntity(nvps,HTTP.UTF_8));
  HttpResponse response=httpclient.execute(postMethod);
  Log.info(logClass,methodName,"String_Node_Str" + response.getStatusLine().getStatusCode());
  String content=EntityUtils.toString(response.getEntity());
  EntityUtils.consume(response.getEntity());
  System.out.println("String_Node_Str" + content);
  int status=response.getStatusLine().getStatusCode();
  assertTrue("String_Node_Str" + status,status == HttpServletResponse.SC_MOVED_TEMPORARILY);
  Header header=response.getFirstHeader("String_Node_Str");
  String location=header.getValue();
  Log.info(logClass,methodName,"String_Node_Str" + location);
  return location;
}

Fixed version (ground truth):
public String executeCustomFormLogin(HttpClient httpclient,String url,String username,String password,String viewState) throws Exception {
  String methodName="String_Node_Str";
  Log.info(logClass,methodName,"String_Node_Str" + url + "String_Node_Str"+ username+ "String_Node_Str"+ password+ "String_Node_Str"+ viewState);
  HttpPost postMethod=new HttpPost(url);
  List<NameValuePair> nvps=new ArrayList<NameValuePair>();
  nvps.add(new BasicNameValuePair("String_Node_Str",username));
  nvps.add(new BasicNameValuePair("String_Node_Str",password));
  nvps.add(new BasicNameValuePair("String_Node_Str","String_Node_Str"));
  nvps.add(new BasicNameValuePair("String_Node_Str","String_Node_Str"));
  if (viewState != null) {
    nvps.add(new BasicNameValuePair("String_Node_Str",viewState));
  }
  postMethod.setEntity(new UrlEncodedFormEntity(nvps,HTTP.UTF_8));
  HttpResponse response=httpclient.execute(postMethod);
  Log.info(logClass,methodName,"String_Node_Str" + response.getStatusLine().getStatusCode());
  String content=EntityUtils.toString(response.getEntity());
  EntityUtils.consume(response.getEntity());
  Log.info(logClass,methodName,"String_Node_Str" + content);
  int status=response.getStatusLine().getStatusCode();
  assertTrue("String_Node_Str" + status,status == HttpServletResponse.SC_MOVED_TEMPORARILY);
  Header header=response.getFirstHeader("String_Node_Str");
  String location=header.getValue();
  Log.info(logClass,methodName,"String_Node_Str" + location);
  return location;
}
Program: 34827
Project: 34827
Buggy source:
public static void createJar(LibertyServer server,String dir,String jarName,boolean addJarResources,String... packageNames) throws Exception {
  String baseDir=DIR_PUBLISH + server.getServerName() + "String_Node_Str"+ dir+ "String_Node_Str";
  JavaArchive jar=null;
  if (jarName != null) {
    LOG.info("String_Node_Str" + jarName + "String_Node_Str"+ addJarResources);
    jar=ShrinkWrap.create(JavaArchive.class,jarName);
    if (packageNames != null) {
      for (      String packageName : packageNames) {
        if (packageName.contains("String_Node_Str")) {
          jar.addPackage(packageName);
        }
      }
    }
    if (addJarResources)     ShrinkHelper.addDirectory(jar,"String_Node_Str" + jarName + "String_Node_Str");
  }
  ShrinkHelper.exportArtifact(jar,DIR_PUBLISH + server.getServerName() + "String_Node_Str"+ dir);
}

Fixed version (ground truth):
public static void createJar(LibertyServer server,String dir,String jarName,boolean addJarResources,String... packageNames) throws Exception {
  String baseDir=DIR_PUBLISH + server.getServerName() + "String_Node_Str"+ dir+ "String_Node_Str";
  JavaArchive jar=null;
  if (jarName != null) {
    LOG.info("String_Node_Str" + jarName + "String_Node_Str"+ addJarResources);
    jar=ShrinkWrap.create(JavaArchive.class,jarName);
    if (packageNames != null) {
      for (      String packageName : packageNames) {
        if (packageName.contains("String_Node_Str")) {
          jar.addPackage(packageName);
        }
      }
    }
    if (addJarResources)     ShrinkHelper.addDirectory(jar,"String_Node_Str" + jarName + "String_Node_Str");
  }
  ShrinkHelper.exportArtifact(jar,DIR_PUBLISH + server.getServerName() + "String_Node_Str"+ dir,true,true);
}
Program: 34829
Project: 34829
Buggy source:
public static void packageWarsToEar(LibertyServer server,String dir,String earName,boolean addEarResources,String... warFiles) throws Exception {
  String baseDir=DIR_PUBLISH + server.getServerName() + "String_Node_Str"+ dir+ "String_Node_Str";
  EnterpriseArchive ear=ShrinkWrap.create(EnterpriseArchive.class,earName);
  if (addEarResources) {
    ShrinkHelper.addDirectory(ear,"String_Node_Str" + earName + "String_Node_Str");
  }
  for (  String warFile : warFiles) {
    WebArchive war=ShrinkWrap.createFromZipFile(WebArchive.class,new File(baseDir + warFile));
    ear.addAsModule(war);
  }
  ShrinkHelper.exportArtifact(ear,DIR_PUBLISH + server.getServerName() + "String_Node_Str"+ dir);
}

Fixed version (ground truth):
public static void packageWarsToEar(LibertyServer server,String dir,String earName,boolean addEarResources,String... warFiles) throws Exception {
  String baseDir=DIR_PUBLISH + server.getServerName() + "String_Node_Str"+ dir+ "String_Node_Str";
  EnterpriseArchive ear=ShrinkWrap.create(EnterpriseArchive.class,earName);
  if (addEarResources) {
    ShrinkHelper.addDirectory(ear,"String_Node_Str" + earName + "String_Node_Str");
  }
  for (  String warFile : warFiles) {
    WebArchive war=ShrinkWrap.createFromZipFile(WebArchive.class,new File(baseDir + warFile));
    ear.addAsModule(war);
  }
  ShrinkHelper.exportArtifact(ear,DIR_PUBLISH + server.getServerName() + "String_Node_Str"+ dir,true,true);
}
Program: 34830
Project: 34830
Buggy source:
public static void exportEar(LibertyServer server,String dir,EnterpriseArchive ear) throws Exception {
  ShrinkHelper.exportArtifact(ear,DIR_PUBLISH + server.getServerName() + "String_Node_Str"+ dir);
}

Fixed version (ground truth):
public static void exportEar(LibertyServer server,String dir,EnterpriseArchive ear) throws Exception {
  ShrinkHelper.exportArtifact(ear,DIR_PUBLISH + server.getServerName() + "String_Node_Str"+ dir,true,true);
}