nus-yam/ex-repair huggingface dataset:
Program: 34871
Project: 34871
Buggy source:
@SuppressWarnings("String_Node_Str") @Before public void setUp() throws Exception {
  ici=mockery.mock(InvocationContext.class,"String_Node_Str");
  icm=mockery.mock(InvocationContext.class,"String_Node_Str");
  mpp=mockery.mock(ModulePropertiesProvider.class);
  mppi=mockery.mock(Instance.class,"String_Node_Str");
  wasc=mockery.mock(WebAppSecurityConfig.class);
  ruh=mockery.mock(ReferrerURLCookieHandler.class);
  hmc=mockery.mock(HttpMessageContext.class);
  mi=mockery.mock(MessageInfo.class);
  wr=mockery.mock(WebRequest.class);
  smd=mockery.mock(SecurityMetadata.class);
  rd=mockery.mock(RequestDispatcher.class);
  req=mockery.mock(HttpServletRequest.class);
  res=mockery.mock(HttpServletResponse.class);
  elpi=mockery.mock(ELProcessor.class,"String_Node_Str");
  elpm=mockery.mock(ELProcessor.class,"String_Node_Str");
  cdi=mockery.mock(CDI.class);
  ltci=new LoginToContinueInterceptor(){
    @Override protected boolean isMethodToIntercept(    InvocationContext ic){
      return isInterceptedMethod;
    }
    @Override protected Class getClass(    InvocationContext ic){
      return hamClass;
    }
    protected Class getTargetClass(    InvocationContext ic){
      return hamClass;
    }
    @Override protected WebAppSecurityConfig getWebSAppSeurityConfig(){
      return wasc;
    }
    @Override protected ELProcessor getELProcessorWithAppModuleBeanManagerELResolver(){
      return elp;
    }
    @Override protected CDI getCDI(){
      return cdi;
    }
  }
;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Before public void setUp() throws Exception {
  ici=mockery.mock(InvocationContext.class,"String_Node_Str");
  icm=mockery.mock(InvocationContext.class,"String_Node_Str");
  mpp=mockery.mock(ModulePropertiesProvider.class);
  mppi=mockery.mock(Instance.class,"String_Node_Str");
  wasc=mockery.mock(WebAppSecurityConfig.class);
  ruh=mockery.mock(ReferrerURLCookieHandler.class);
  hmc=mockery.mock(HttpMessageContext.class);
  ap=mockery.mock(AuthenticationParameters.class);
  mi=mockery.mock(MessageInfo.class);
  wr=mockery.mock(WebRequest.class);
  smd=mockery.mock(SecurityMetadata.class);
  rd=mockery.mock(RequestDispatcher.class);
  req=mockery.mock(HttpServletRequest.class);
  res=mockery.mock(HttpServletResponse.class);
  elpi=mockery.mock(ELProcessor.class,"String_Node_Str");
  elpm=mockery.mock(ELProcessor.class,"String_Node_Str");
  cdi=mockery.mock(CDI.class);
  ltci=new LoginToContinueInterceptor(){
    @Override protected boolean isMethodToIntercept(    InvocationContext ic){
      return isInterceptedMethod;
    }
    @Override protected Class getClass(    InvocationContext ic){
      return hamClass;
    }
    protected Class getTargetClass(    InvocationContext ic){
      return hamClass;
    }
    @Override protected WebAppSecurityConfig getWebSAppSeurityConfig(){
      return wasc;
    }
    @Override protected ELProcessor getELProcessorWithAppModuleBeanManagerELResolver(){
      return elp;
    }
    @Override protected CDI getCDI(){
      return cdi;
    }
  }
;
}
Program: 34872
Project: 34872
Buggy source:
/** 
 * valid method. valid objects. use deferred EL. Make sure that el resolution happens every interception. Make sure that AuthenticationStatus.SUCCESS is returned along with redirection to the original url.
 */
@Test public void testInterceptContinueFormELDeferred() throws Exception {
  isInterceptedMethod=true;
  hamClass=FORM_CLASS;
  ltci.setMPP(mpp);
  final String elValue="String_Node_Str";
  final String elWrapped="String_Node_Str" + elValue + "String_Node_Str";
  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_USEFORWARDTOLOGINEXPRESSION,elWrapped);
  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);
  withELP(elpm,elValue,Boolean.FALSE).withNoELP(elpi);
  ltci.initialize(ici);
  assertEquals("String_Node_Str",expect,ltci.intercept(icm));
}

Fixed version (ground truth):
/** 
 * valid method. valid objects. use deferred EL. Make sure that el resolution happens every interception. Make sure that AuthenticationStatus.SUCCESS is returned along with redirection to the original url.
 */
@Test public void testInterceptContinueFormELDeferred() throws Exception {
  isInterceptedMethod=true;
  hamClass=FORM_CLASS;
  ltci.setMPP(mpp);
  final String elValue="String_Node_Str";
  final String elWrapped="String_Node_Str" + elValue + "String_Node_Str";
  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_USEFORWARDTOLOGINEXPRESSION,elWrapped);
  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).withAuthParams();
  withELP(elpm,elValue,Boolean.FALSE).withNoELP(elpi);
  ltci.initialize(ici);
  assertEquals("String_Node_Str",expect,ltci.intercept(icm));
}
Program: 34873
Project: 34873
Buggy source:
/** 
 * valid method. valid objects. Make sure that AuthenticationStatus.SUCCESS is returned along with redirection to the original url.
 */
@Test public void testInterceptSuccessForm() throws Exception {
  isInterceptedMethod=true;
  hamClass=FORM_CLASS;
  ltci.setMPP(mpp);
  Object expect=AuthenticationStatus.SUCCESS;
  Properties props=new Properties();
  String storedReq="String_Node_Str";
  String requestUrl="String_Node_Str";
  withInvocationContext(expect).withParams().withReferrer().withGetURL(storedReq,requestUrl);
  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 testInterceptSuccessForm() throws Exception {
  isInterceptedMethod=true;
  hamClass=FORM_CLASS;
  ltci.setMPP(mpp);
  Object expect=AuthenticationStatus.SUCCESS;
  Properties props=new Properties();
  String storedReq="String_Node_Str";
  String requestUrl="String_Node_Str";
  withInvocationContext(expect).withParams().withReferrer().withGetURL(storedReq,requestUrl).withAuthParams();
  assertEquals("String_Node_Str",expect,ltci.intercept(icm));
}
Program: 34874
Project: 34874
Buggy source:
/** 
 * valid method. valid objects. Make sure that AuthenticationStatus.SUCCESS is returned along with redirection to the original url.
 */
@Test public void testInterceptSuccessCustomForm() throws Exception {
  isInterceptedMethod=true;
  hamClass=CUSTOM_FORM_CLASS;
  ltci.setMPP(mpp);
  Object expect=AuthenticationStatus.SUCCESS;
  Properties props=new Properties();
  String storedReq="String_Node_Str";
  String requestUrl="String_Node_Str";
  withInvocationContext(expect).withParams().withReferrer().withGetURL(storedReq,requestUrl);
  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 testInterceptSuccessCustomForm() throws Exception {
  isInterceptedMethod=true;
  hamClass=CUSTOM_FORM_CLASS;
  ltci.setMPP(mpp);
  Object expect=AuthenticationStatus.SUCCESS;
  Properties props=new Properties();
  String storedReq="String_Node_Str";
  String requestUrl="String_Node_Str";
  withInvocationContext(expect).withParams().withReferrer().withGetURL(storedReq,requestUrl).withAuthParams();
  assertEquals("String_Node_Str",expect,ltci.intercept(icm));
}
Program: 34875
Project: 34875
Buggy source:
/** 
 * valid method. valid objects. use immediate EL. Make sure that el resolution happens during initiallization, and does not happen  while intercepting the request. Make sure that AuthenticationStatus.SUCCESS is returned along with redirection to the original url.
 */
@Test public void testInterceptContinueFormELImmediate() throws Exception {
  isInterceptedMethod=true;
  hamClass=FORM_CLASS;
  ltci.setMPP(mpp);
  final String elValue="String_Node_Str";
  final String elWrapped="String_Node_Str" + elValue + "String_Node_Str";
  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_USEFORWARDTOLOGINEXPRESSION,elWrapped);
  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);
  withELP(elpi,elValue,Boolean.FALSE).withNoELP(elpm);
  ltci.initialize(ici);
  assertEquals("String_Node_Str",expect,ltci.intercept(icm));
}

Fixed version (ground truth):
/** 
 * valid method. valid objects. use immediate EL. Make sure that el resolution happens during initiallization, and does not happen  while intercepting the request. Make sure that AuthenticationStatus.SUCCESS is returned along with redirection to the original url.
 */
@Test public void testInterceptContinueFormELImmediate() throws Exception {
  isInterceptedMethod=true;
  hamClass=FORM_CLASS;
  ltci.setMPP(mpp);
  final String elValue="String_Node_Str";
  final String elWrapped="String_Node_Str" + elValue + "String_Node_Str";
  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_USEFORWARDTOLOGINEXPRESSION,elWrapped);
  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).withAuthParams();
  withELP(elpi,elValue,Boolean.FALSE).withNoELP(elpm);
  ltci.initialize(ici);
  assertEquals("String_Node_Str",expect,ltci.intercept(icm));
}
Program: 34876
Project: 34876
Buggy source:
@Override public boolean authenticate(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  Subject callerSubject=subjectManager.getCallerSubject();
  if (!subjectHelper.isUnauthenticated(callerSubject)) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())     Tr.debug(tc,"String_Node_Str");
    return true;
  }
  WebReply webReply=PERMIT_REPLY;
  boolean result=true;
  WebRequest webRequest=new WebRequestImpl(req,resp,getSecurityMetadata(),webAppSecConfig);
  AuthenticationResult authResult=null;
  if (isJaspiEnabled && ((JaspiService)webAuthenticatorRef.getService("String_Node_Str")).isAnyProviderRegistered(webRequest)) {
    authResult=providerAuthenticatorProxy.handleJaspi(webRequest,null);
  }
  if (authResult == null || authResult.getStatus() == AuthResult.CONTINUE) {
    authResult=authenticateRequest(webRequest);
  }
  if (authResult.getStatus() == AuthResult.SUCCESS) {
    getAuthenticateApi().postProgrammaticAuthenticate(req,resp,authResult);
  }
 else {
    String realm=authResult.realm;
    if (realm == null) {
      realm=collabUtils.getUserRegistryRealm(securityServiceRef);
    }
    webReply=createReplyForAuthnFailure(authResult,realm);
    result=false;
  }
  authResult.setTargetRealm(authResult.realm != null ? authResult.realm : collabUtils.getUserRegistryRealm(securityServiceRef));
  webReply.writeResponse(resp);
  Audit.audit(Audit.EventID.SECURITY_AUTHN_01,webRequest,authResult,Integer.valueOf(webReply.getStatusCode()));
  return result;
}

Fixed version (ground truth):
@Override public boolean authenticate(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  Subject callerSubject=subjectManager.getCallerSubject();
  if (!subjectHelper.isUnauthenticated(callerSubject)) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())     Tr.debug(tc,"String_Node_Str");
    return true;
  }
  WebReply webReply=PERMIT_REPLY;
  boolean result=true;
  WebRequest webRequest=new WebRequestImpl(req,resp,getSecurityMetadata(),webAppSecConfig);
  AuthenticationResult authResult=null;
  if (isJaspiEnabled && ((JaspiService)webAuthenticatorRef.getService("String_Node_Str")).isAnyProviderRegistered(webRequest)) {
    authResult=providerAuthenticatorProxy.handleJaspi(webRequest,null);
  }
  if (authResult == null || authResult.getStatus() == AuthResult.CONTINUE) {
    authResult=authenticateRequest(webRequest);
  }
  if (authResult.getStatus() == AuthResult.SUCCESS) {
    getAuthenticateApi().postProgrammaticAuthenticate(req,resp,authResult);
  }
 else {
    String realm=authResult.realm;
    if (realm == null) {
      realm=collabUtils.getUserRegistryRealm(securityServiceRef);
    }
    webReply=createReplyForAuthnFailure(authResult,realm);
    result=false;
  }
  authResult.setTargetRealm(authResult.realm != null ? authResult.realm : collabUtils.getUserRegistryRealm(securityServiceRef));
  if (!resp.isCommitted()) {
    webReply.writeResponse(resp);
  }
  Audit.audit(Audit.EventID.SECURITY_AUTHN_01,webRequest,authResult,Integer.valueOf(webReply.getStatusCode()));
  return result;
}
Program: 34877
Project: 34877
Buggy source:
@Test public void testAuthenticateMethodFailure() throws Exception {
  secColl=new WebAppSecurityCollaboratorImplTestDouble2();
  final WebModuleMetaData wmmd=createWebModuleMetaDataMock();
  setTestWebModuleMetaDataOnThread(wmmd);
  final AuthenticationResult authResult=new AuthenticationResult(AuthResult.FAILURE,(String)null);
  this.authResult=authResult;
  createTestSpecificUserRegistryExpectations("String_Node_Str");
  mock.checking(new Expectations(){
{
      allowing(commonSecurityMetadata).getLoginConfiguration();
      will(returnValue(commonloginConfiguration));
      allowing(commonloginConfiguration).getAuthenticationMethod();
      will(returnValue("String_Node_Str"));
      allowing(commonReq).getCookies();
      will(returnValue(null));
      allowing(authenticator).authenticate(commonWebRequest);
      will(returnValue(authResult));
      one(commongResp).sendError(403,"String_Node_Str");
    }
  }
);
  configProps.put(WebAppSecurityConfigImpl.CFG_KEY_SINGLE_SIGN_ON_ENABLED,false);
  secColl.setAuthenticatorFactory(authenticatorFactory);
  secColl.setSecurityService(securityServiceRef);
  secColl.setTaiService(taiServiceRef);
  secColl.activate(cc,configProps);
  assertFalse(secColl.authenticate(commonReq,commongResp));
}

Fixed version (ground truth):
@Test public void testAuthenticateMethodFailure() throws Exception {
  secColl=new WebAppSecurityCollaboratorImplTestDouble2();
  final WebModuleMetaData wmmd=createWebModuleMetaDataMock();
  setTestWebModuleMetaDataOnThread(wmmd);
  final AuthenticationResult authResult=new AuthenticationResult(AuthResult.FAILURE,(String)null);
  this.authResult=authResult;
  createTestSpecificUserRegistryExpectations("String_Node_Str");
  mock.checking(new Expectations(){
{
      allowing(commonSecurityMetadata).getLoginConfiguration();
      will(returnValue(commonloginConfiguration));
      allowing(commonloginConfiguration).getAuthenticationMethod();
      will(returnValue("String_Node_Str"));
      allowing(commonReq).getCookies();
      will(returnValue(null));
      allowing(authenticator).authenticate(commonWebRequest);
      will(returnValue(authResult));
      one(commongResp).isCommitted();
      will(returnValue(false));
      one(commongResp).sendError(403,"String_Node_Str");
    }
  }
);
  configProps.put(WebAppSecurityConfigImpl.CFG_KEY_SINGLE_SIGN_ON_ENABLED,false);
  secColl.setAuthenticatorFactory(authenticatorFactory);
  secColl.setSecurityService(securityServiceRef);
  secColl.setTaiService(taiServiceRef);
  secColl.activate(cc,configProps);
  assertFalse(secColl.authenticate(commonReq,commongResp));
}
Program: 34878
Project: 34878
Buggy source:
@Test public void testAuthenticateMethodSuccess() throws Exception {
  Subject subject=createAuthenticatedSubject();
  secColl=new WebAppSecurityCollaboratorImplTestDouble2();
  final AuthenticationResult authResult=new AuthenticationResult(AuthResult.SUCCESS,subject);
  final WebModuleMetaData wmmd=createWebModuleMetaDataMock();
  setTestWebModuleMetaDataOnThread(wmmd);
  this.authResult=authResult;
  mock.checking(new Expectations(){
{
      allowing(userRegistry).getRealm();
    }
  }
);
  configProps.put(WebAppSecurityConfigImpl.CFG_KEY_SINGLE_SIGN_ON_ENABLED,false);
  secColl.setAuthenticatorFactory(authenticatorFactory);
  secColl.setSecurityService(securityServiceRef);
  secColl.setTaiService(taiServiceRef);
  secColl.activate(cc,configProps);
  secColl.authenticate(commonReq,commongResp);
  assertEquals(subject,subjectManager.getCallerSubject());
  assertEquals(subject,subjectManager.getInvocationSubject());
}

Fixed version (ground truth):
@Test public void testAuthenticateMethodSuccess() throws Exception {
  Subject subject=createAuthenticatedSubject();
  secColl=new WebAppSecurityCollaboratorImplTestDouble2();
  final AuthenticationResult authResult=new AuthenticationResult(AuthResult.SUCCESS,subject);
  final WebModuleMetaData wmmd=createWebModuleMetaDataMock();
  setTestWebModuleMetaDataOnThread(wmmd);
  this.authResult=authResult;
  mock.checking(new Expectations(){
{
      allowing(userRegistry).getRealm();
      one(commongResp).isCommitted();
      will(returnValue(false));
    }
  }
);
  configProps.put(WebAppSecurityConfigImpl.CFG_KEY_SINGLE_SIGN_ON_ENABLED,false);
  secColl.setAuthenticatorFactory(authenticatorFactory);
  secColl.setSecurityService(securityServiceRef);
  secColl.setTaiService(taiServiceRef);
  secColl.activate(cc,configProps);
  secColl.authenticate(commonReq,commongResp);
  assertEquals(subject,subjectManager.getCallerSubject());
  assertEquals(subject,subjectManager.getInvocationSubject());
}
Program: 34880
Project: 34880
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=getUrl(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;
  updateFormLoginConfiguration(loginPage,errorPage);
  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: 34881
Project: 34881
Buggy source:
private void updateFormLoginConfiguration(String loginPage,String errorPage,SecurityMetadata securityMetadata){
  if (loginPage != null && errorPage != null) {
    FormLoginConfiguration flc=new FormLoginConfigurationImpl(loginPage,errorPage);
    LoginConfiguration lc=new LoginConfigurationImpl(LoginConfiguration.FORM,null,flc);
    securityMetadata.setLoginConfiguration(lc);
    if (tc.isDebugEnabled())     Tr.debug(tc,"String_Node_Str" + lc);
  }
}

Fixed version (ground truth):
private void updateFormLoginConfiguration(String loginPage,String errorPage){
  if (loginPage != null && errorPage != null) {
    FormLoginConfiguration flc=new FormLoginConfigurationImpl(loginPage,errorPage);
    LoginConfiguration lc=new LoginConfigurationImpl(LoginConfiguration.FORM,null,flc);
    getSecurityMetadata().setLoginConfiguration(lc);
    if (tc.isDebugEnabled())     Tr.debug(tc,"String_Node_Str" + lc);
  }
}
Program: 34882
Project: 34882
Buggy source:
@Test public void testGetRunningTaskCount() throws Exception {
  PolicyExecutor executor=provider.create("String_Node_Str").maxConcurrency(2);
  CountDownLatch beginLatch1=new CountDownLatch(1);
  CountDownLatch continueLatch1=new CountDownLatch(1);
  CountDownLatch beginLatch2=new CountDownLatch(1);
  CountDownLatch continueLatch2=new CountDownLatch(1);
  assertEquals(0,executor.getRunningTaskCount());
  CountDownTask task1=new CountDownTask(beginLatch1,continueLatch1,TimeUnit.HOURS.toNanos(1));
  Future<Boolean> future1=executor.submit(task1);
  assertTrue(beginLatch1.await(TIMEOUT_NS,TimeUnit.NANOSECONDS));
  assertEquals(1,executor.getRunningTaskCount());
  CountDownTask task2=new CountDownTask(beginLatch2,continueLatch2,TimeUnit.HOURS.toNanos(1));
  Future<Boolean> future2=executor.submit(task2);
  assertTrue(beginLatch2.await(TIMEOUT_NS,TimeUnit.NANOSECONDS));
  assertEquals(2,executor.getRunningTaskCount());
  continueLatch1.countDown();
  assertTrue(future1.get(TIMEOUT_NS,TimeUnit.NANOSECONDS));
  assertEquals(1,executor.getRunningTaskCount());
  executor.shutdown();
  assertEquals(1,executor.getRunningTaskCount());
  continueLatch2.countDown();
  assertTrue(future2.get(TIMEOUT_NS,TimeUnit.NANOSECONDS));
  assertEquals(0,executor.getRunningTaskCount());
}

Fixed version (ground truth):
@Test public void testGetRunningTaskCount() throws Exception {
  PolicyExecutor executor=provider.create("String_Node_Str").maxConcurrency(2);
  CountDownLatch beginLatch1=new CountDownLatch(1);
  CountDownLatch continueLatch1=new CountDownLatch(1);
  CountDownLatch beginLatch2=new CountDownLatch(1);
  CountDownLatch continueLatch2=new CountDownLatch(1);
  assertEquals(0,executor.getRunningTaskCount());
  CountDownTask task1=new CountDownTask(beginLatch1,continueLatch1,TimeUnit.HOURS.toNanos(1));
  Future<Boolean> future1=executor.submit(task1);
  assertTrue(beginLatch1.await(TIMEOUT_NS,TimeUnit.NANOSECONDS));
  assertEquals(1,executor.getRunningTaskCount());
  CountDownTask task2=new CountDownTask(beginLatch2,continueLatch2,TimeUnit.HOURS.toNanos(1));
  Future<Boolean> future2=executor.submit(task2);
  assertTrue(beginLatch2.await(TIMEOUT_NS,TimeUnit.NANOSECONDS));
  assertEquals(2,executor.getRunningTaskCount());
  continueLatch1.countDown();
  assertTrue(future1.get(TIMEOUT_NS,TimeUnit.NANOSECONDS));
  for (long start=System.nanoTime(); executor.getRunningTaskCount() != 1 && System.nanoTime() - start < TIMEOUT_NS; Thread.sleep(200))   ;
  assertEquals(1,executor.getRunningTaskCount());
  executor.shutdown();
  assertEquals(1,executor.getRunningTaskCount());
  continueLatch2.countDown();
  assertTrue(future2.get(TIMEOUT_NS,TimeUnit.NANOSECONDS));
  for (long start=System.nanoTime(); executor.getRunningTaskCount() != 0 && System.nanoTime() - start < TIMEOUT_NS; Thread.sleep(200))   ;
  assertEquals(0,executor.getRunningTaskCount());
}
Program: 34883
Project: 34883
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: 34884
Project: 34884
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: 34885
Project: 34885
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: 34886
Project: 34886
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: 34887
Project: 34887
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));
}
Program: 34888
Project: 34888
Buggy source:
@SuppressWarnings("String_Node_Str") @Before public void setUp() throws Exception {
  ici=mockery.mock(InvocationContext.class,"String_Node_Str");
  icm=mockery.mock(InvocationContext.class,"String_Node_Str");
  mpp=mockery.mock(ModulePropertiesProvider.class);
  mppi=mockery.mock(Instance.class,"String_Node_Str");
  wasc=mockery.mock(WebAppSecurityConfig.class);
  ruh=mockery.mock(ReferrerURLCookieHandler.class);
  hmc=mockery.mock(HttpMessageContext.class);
  mi=mockery.mock(MessageInfo.class);
  wr=mockery.mock(WebRequest.class);
  smd=mockery.mock(SecurityMetadata.class);
  rd=mockery.mock(RequestDispatcher.class);
  req=mockery.mock(HttpServletRequest.class);
  res=mockery.mock(HttpServletResponse.class);
  elpi=mockery.mock(ELProcessor.class,"String_Node_Str");
  elpm=mockery.mock(ELProcessor.class,"String_Node_Str");
  cdi=mockery.mock(CDI.class);
  ltci=new LoginToContinueInterceptor(){
    @Override protected boolean isMethodToIntercept(    InvocationContext ic){
      return isInterceptedMethod;
    }
    @Override protected Class getClass(    InvocationContext ic){
      return hamClass;
    }
    protected Class getTargetClass(    InvocationContext ic){
      return hamClass;
    }
    @Override protected WebAppSecurityConfig getWebSAppSeurityConfig(){
      return wasc;
    }
    @Override protected ELProcessor getELProcessorWithAppModuleBeanManagerELResolver(){
      return elp;
    }
    @Override protected CDI getCDI(){
      return cdi;
    }
  }
;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Before public void setUp() throws Exception {
  ici=mockery.mock(InvocationContext.class,"String_Node_Str");
  icm=mockery.mock(InvocationContext.class,"String_Node_Str");
  mpp=mockery.mock(ModulePropertiesProvider.class);
  mppi=mockery.mock(Instance.class,"String_Node_Str");
  wasc=mockery.mock(WebAppSecurityConfig.class);
  ruh=mockery.mock(ReferrerURLCookieHandler.class);
  hmc=mockery.mock(HttpMessageContext.class);
  ap=mockery.mock(AuthenticationParameters.class);
  mi=mockery.mock(MessageInfo.class);
  wr=mockery.mock(WebRequest.class);
  smd=mockery.mock(SecurityMetadata.class);
  rd=mockery.mock(RequestDispatcher.class);
  req=mockery.mock(HttpServletRequest.class);
  res=mockery.mock(HttpServletResponse.class);
  elpi=mockery.mock(ELProcessor.class,"String_Node_Str");
  elpm=mockery.mock(ELProcessor.class,"String_Node_Str");
  cdi=mockery.mock(CDI.class);
  ltci=new LoginToContinueInterceptor(){
    @Override protected boolean isMethodToIntercept(    InvocationContext ic){
      return isInterceptedMethod;
    }
    @Override protected Class getClass(    InvocationContext ic){
      return hamClass;
    }
    protected Class getTargetClass(    InvocationContext ic){
      return hamClass;
    }
    @Override protected WebAppSecurityConfig getWebSAppSeurityConfig(){
      return wasc;
    }
    @Override protected ELProcessor getELProcessorWithAppModuleBeanManagerELResolver(){
      return elp;
    }
    @Override protected CDI getCDI(){
      return cdi;
    }
  }
;
}
Program: 34889
Project: 34889
Buggy source:
/** 
 * valid method. valid objects. use deferred EL. Make sure that el resolution happens every interception. Make sure that AuthenticationStatus.SUCCESS is returned along with redirection to the original url.
 */
@Test public void testInterceptContinueFormELDeferred() throws Exception {
  isInterceptedMethod=true;
  hamClass=FORM_CLASS;
  ltci.setMPP(mpp);
  final String elValue="String_Node_Str";
  final String elWrapped="String_Node_Str" + elValue + "String_Node_Str";
  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_USEFORWARDTOLOGINEXPRESSION,elWrapped);
  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);
  withELP(elpm,elValue,Boolean.FALSE).withNoELP(elpi);
  ltci.initialize(ici);
  assertEquals("String_Node_Str",expect,ltci.intercept(icm));
}

Fixed version (ground truth):
/** 
 * valid method. valid objects. use deferred EL. Make sure that el resolution happens every interception. Make sure that AuthenticationStatus.SUCCESS is returned along with redirection to the original url.
 */
@Test public void testInterceptContinueFormELDeferred() throws Exception {
  isInterceptedMethod=true;
  hamClass=FORM_CLASS;
  ltci.setMPP(mpp);
  final String elValue="String_Node_Str";
  final String elWrapped="String_Node_Str" + elValue + "String_Node_Str";
  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_USEFORWARDTOLOGINEXPRESSION,elWrapped);
  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).withAuthParams();
  withELP(elpm,elValue,Boolean.FALSE).withNoELP(elpi);
  ltci.initialize(ici);
  assertEquals("String_Node_Str",expect,ltci.intercept(icm));
}
Program: 34890
Project: 34890
Buggy source:
/** 
 * valid method. valid objects. Make sure that AuthenticationStatus.SUCCESS is returned along with redirection to the original url.
 */
@Test public void testInterceptSuccessForm() throws Exception {
  isInterceptedMethod=true;
  hamClass=FORM_CLASS;
  ltci.setMPP(mpp);
  Object expect=AuthenticationStatus.SUCCESS;
  Properties props=new Properties();
  String storedReq="String_Node_Str";
  String requestUrl="String_Node_Str";
  withInvocationContext(expect).withParams().withReferrer().withGetURL(storedReq,requestUrl);
  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 testInterceptSuccessForm() throws Exception {
  isInterceptedMethod=true;
  hamClass=FORM_CLASS;
  ltci.setMPP(mpp);
  Object expect=AuthenticationStatus.SUCCESS;
  Properties props=new Properties();
  String storedReq="String_Node_Str";
  String requestUrl="String_Node_Str";
  withInvocationContext(expect).withParams().withReferrer().withGetURL(storedReq,requestUrl).withAuthParams();
  assertEquals("String_Node_Str",expect,ltci.intercept(icm));
}
Program: 34891
Project: 34891
Buggy source:
/** 
 * valid method. valid objects. Make sure that AuthenticationStatus.SUCCESS is returned along with redirection to the original url.
 */
@Test public void testInterceptSuccessCustomForm() throws Exception {
  isInterceptedMethod=true;
  hamClass=CUSTOM_FORM_CLASS;
  ltci.setMPP(mpp);
  Object expect=AuthenticationStatus.SUCCESS;
  Properties props=new Properties();
  String storedReq="String_Node_Str";
  String requestUrl="String_Node_Str";
  withInvocationContext(expect).withParams().withReferrer().withGetURL(storedReq,requestUrl);
  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 testInterceptSuccessCustomForm() throws Exception {
  isInterceptedMethod=true;
  hamClass=CUSTOM_FORM_CLASS;
  ltci.setMPP(mpp);
  Object expect=AuthenticationStatus.SUCCESS;
  Properties props=new Properties();
  String storedReq="String_Node_Str";
  String requestUrl="String_Node_Str";
  withInvocationContext(expect).withParams().withReferrer().withGetURL(storedReq,requestUrl).withAuthParams();
  assertEquals("String_Node_Str",expect,ltci.intercept(icm));
}
Program: 34892
Project: 34892
Buggy source:
/** 
 * valid method. valid objects. use immediate EL. Make sure that el resolution happens during initiallization, and does not happen  while intercepting the request. Make sure that AuthenticationStatus.SUCCESS is returned along with redirection to the original url.
 */
@Test public void testInterceptContinueFormELImmediate() throws Exception {
  isInterceptedMethod=true;
  hamClass=FORM_CLASS;
  ltci.setMPP(mpp);
  final String elValue="String_Node_Str";
  final String elWrapped="String_Node_Str" + elValue + "String_Node_Str";
  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_USEFORWARDTOLOGINEXPRESSION,elWrapped);
  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);
  withELP(elpi,elValue,Boolean.FALSE).withNoELP(elpm);
  ltci.initialize(ici);
  assertEquals("String_Node_Str",expect,ltci.intercept(icm));
}

Fixed version (ground truth):
/** 
 * valid method. valid objects. use immediate EL. Make sure that el resolution happens during initiallization, and does not happen  while intercepting the request. Make sure that AuthenticationStatus.SUCCESS is returned along with redirection to the original url.
 */
@Test public void testInterceptContinueFormELImmediate() throws Exception {
  isInterceptedMethod=true;
  hamClass=FORM_CLASS;
  ltci.setMPP(mpp);
  final String elValue="String_Node_Str";
  final String elWrapped="String_Node_Str" + elValue + "String_Node_Str";
  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_USEFORWARDTOLOGINEXPRESSION,elWrapped);
  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).withAuthParams();
  withELP(elpi,elValue,Boolean.FALSE).withNoELP(elpm);
  ltci.initialize(ici);
  assertEquals("String_Node_Str",expect,ltci.intercept(icm));
}
Program: 34893
Project: 34893
Buggy source:
@Override public boolean authenticate(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  Subject callerSubject=subjectManager.getCallerSubject();
  if (!subjectHelper.isUnauthenticated(callerSubject)) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())     Tr.debug(tc,"String_Node_Str");
    return true;
  }
  WebReply webReply=PERMIT_REPLY;
  boolean result=true;
  WebRequest webRequest=new WebRequestImpl(req,resp,getSecurityMetadata(),webAppSecConfig);
  AuthenticationResult authResult=null;
  if (isJaspiEnabled && ((JaspiService)webAuthenticatorRef.getService("String_Node_Str")).isAnyProviderRegistered(webRequest)) {
    authResult=providerAuthenticatorProxy.handleJaspi(webRequest,null);
  }
  if (authResult == null || authResult.getStatus() == AuthResult.CONTINUE) {
    authResult=authenticateRequest(webRequest);
  }
  if (authResult.getStatus() == AuthResult.SUCCESS) {
    getAuthenticateApi().postProgrammaticAuthenticate(req,resp,authResult);
  }
 else {
    String realm=authResult.realm;
    if (realm == null) {
      realm=collabUtils.getUserRegistryRealm(securityServiceRef);
    }
    webReply=createReplyForAuthnFailure(authResult,realm);
    result=false;
  }
  authResult.setTargetRealm(authResult.realm != null ? authResult.realm : collabUtils.getUserRegistryRealm(securityServiceRef));
  webReply.writeResponse(resp);
  Audit.audit(Audit.EventID.SECURITY_AUTHN_01,webRequest,authResult,Integer.valueOf(webReply.getStatusCode()));
  return result;
}

Fixed version (ground truth):
@Override public boolean authenticate(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  Subject callerSubject=subjectManager.getCallerSubject();
  if (!subjectHelper.isUnauthenticated(callerSubject)) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())     Tr.debug(tc,"String_Node_Str");
    return true;
  }
  WebReply webReply=PERMIT_REPLY;
  boolean result=true;
  WebRequest webRequest=new WebRequestImpl(req,resp,getSecurityMetadata(),webAppSecConfig);
  AuthenticationResult authResult=null;
  if (isJaspiEnabled && ((JaspiService)webAuthenticatorRef.getService("String_Node_Str")).isAnyProviderRegistered(webRequest)) {
    authResult=providerAuthenticatorProxy.handleJaspi(webRequest,null);
  }
  if (authResult == null || authResult.getStatus() == AuthResult.CONTINUE) {
    authResult=authenticateRequest(webRequest);
  }
  if (authResult.getStatus() == AuthResult.SUCCESS) {
    getAuthenticateApi().postProgrammaticAuthenticate(req,resp,authResult);
  }
 else {
    String realm=authResult.realm;
    if (realm == null) {
      realm=collabUtils.getUserRegistryRealm(securityServiceRef);
    }
    webReply=createReplyForAuthnFailure(authResult,realm);
    result=false;
  }
  authResult.setTargetRealm(authResult.realm != null ? authResult.realm : collabUtils.getUserRegistryRealm(securityServiceRef));
  if (!resp.isCommitted()) {
    webReply.writeResponse(resp);
  }
  Audit.audit(Audit.EventID.SECURITY_AUTHN_01,webRequest,authResult,Integer.valueOf(webReply.getStatusCode()));
  return result;
}