nus-yam/ex-repair huggingface dataset:
Program: 34604
Project: 34604
Buggy source:
private BasicHttpAuthenticationMechanismTest withNewAuthenticate(Credential cred){
  setNewAuthenticateExpectations().withAuthParamsExpectations(ap).withCredentialExpectations(cred);
  withJaspicSessionEnabled(false);
  return this;
}

Fixed version (ground truth):
private BasicHttpAuthenticationMechanismTest withNewAuthenticate(Credential cred){
  setHttpMessageContextExpectations(true).setNewAuthenticateExpectations().withAuthParamsExpectations(ap).withCredentialExpectations(cred);
  withJaspicSessionEnabled(false);
  return this;
}
Program: 34605
Project: 34605
Buggy source:
@Test public void testValidateRequestRegistersJaspicSession() throws Exception {
  setHttpMessageContextExpectations(true).withAuthorizationHeader(authzHeader).withAuthenticationRequest(false);
  withIdentityStoreHandlerResult(validResult);
  withJaspicSessionEnabled(true);
  withoutJaspicSessionPrincipal();
  setModulePropertiesProvider(realmName);
  assertValidateRequestSUCCESS(REGISTERS_NEW_JASPIC_SESSION);
}

Fixed version (ground truth):
@Test public void testValidateRequestRegistersJaspicSession() throws Exception {
  setHttpMessageContextExpectations(true).withAuthParamsExpectations(null).withAuthorizationHeader(authzHeader).withAuthenticationRequest(false);
  withIdentityStoreHandlerResult(validResult);
  withJaspicSessionEnabled(true);
  withoutJaspicSessionPrincipal();
  setModulePropertiesProvider(realmName);
  assertValidateRequestSUCCESS(REGISTERS_NEW_JASPIC_SESSION);
}
Program: 34606
Project: 34606
Buggy source:
private BasicHttpAuthenticationMechanismTest setNewAuthenticateExpectations(){
  final MessageInfo messageInfo=createMessageInfo(true);
  mockery.checking(new Expectations(){
{
      one(httpMessageContext).getClientSubject();
      will(returnValue(clientSubject));
      never(httpMessageContext).getRequest();
      never(httpMessageContext).getResponse();
      allowing(httpMessageContext).getMessageInfo();
      will(returnValue(messageInfo));
    }
  }
);
  return this;
}

Fixed version (ground truth):
private BasicHttpAuthenticationMechanismTest setNewAuthenticateExpectations(){
  mockery.checking(new Expectations(){
{
      never(httpMessageContext).getResponse();
    }
  }
);
  return this;
}
Program: 34607
Project: 34607
Buggy source:
private CustomFormAuthenticationMechanismTest withMessageContext(final AuthenticationParameters ap) throws Exception {
  mockery.checking(new Expectations(){
{
      allowing(hmc).getClientSubject();
      will(returnValue(cs));
      allowing(hmc).getAuthParameters();
      will(returnValue(ap));
    }
  }
);
  return this;
}

Fixed version (ground truth):
private CustomFormAuthenticationMechanismTest withMessageContext(final AuthenticationParameters ap) throws Exception {
  mockery.checking(new Expectations(){
{
      allowing(hmc).getClientSubject();
      will(returnValue(cs));
      allowing(hmc).getAuthParameters();
      will(returnValue(ap));
      allowing(hmc).getRequest();
      will(returnValue(request));
    }
  }
);
  return this;
}
Program: 34608
Project: 34608
Buggy source:
@Test public void testValidateRequestRegistersJaspicSession() throws Exception {
  withMessageContext(ap).withMessageInfo();
  withUsernamePassword(USER1,PASSWORD1).withIDSBeanInstance(ids,false,false).withSetStatusToResponse(HttpServletResponse.SC_OK);
  withJaspicSessionEnabled(true);
  withoutJaspicSessionPrincipal();
  AuthenticationStatus status=cfam.validateRequest(request,res,hmc);
  assertEquals("String_Node_Str",AuthenticationStatus.SUCCESS,status);
  assertRegisterSessionProperty(true);
}

Fixed version (ground truth):
@Test public void testValidateRequestRegistersJaspicSession() throws Exception {
  withMessageContext(ap).withMessageInfo().withGetResponse();
  withUsernamePassword(USER1,PASSWORD1).withIsNewAuthentication(false);
  withIDSBeanInstance(ids,false,false).withSetStatusToResponse(HttpServletResponse.SC_OK);
  withJaspicSessionEnabled(true);
  withoutJaspicSessionPrincipal();
  AuthenticationStatus status=cfam.validateRequest(request,res,hmc);
  assertEquals("String_Node_Str",AuthenticationStatus.SUCCESS,status);
  assertRegisterSessionProperty(true);
}
Program: 34609
Project: 34609
Buggy source:
@Test public void testValidateRequestNewAuthenticateUsernamePasswordCredSuccess() throws Exception {
  IdentityStoreHandler mish=new MyIdentityStoreHandler();
  withNewAuthenticate(upCred).withMessageInfo().withIDSBeanInstance(ids,false,false).withIDSHandlerBeanInstance(mish);
  withJaspicSessionEnabled(false);
  AuthenticationStatus status=cfam.validateRequest(request,res,hmc);
  assertEquals("String_Node_Str",AuthenticationStatus.SUCCESS,status);
}

Fixed version (ground truth):
@Test public void testValidateRequestNewAuthenticateUsernamePasswordCredSuccess() throws Exception {
  IdentityStoreHandler mish=new MyIdentityStoreHandler();
  withMessageContext(ap).withNewAuthenticate(upCred).withMessageInfo();
  withIDSBeanInstance(ids,false,false).withIDSHandlerBeanInstance(mish);
  withJaspicSessionEnabled(false);
  AuthenticationStatus status=cfam.validateRequest(request,res,hmc);
  assertEquals("String_Node_Str",AuthenticationStatus.SUCCESS,status);
}
Program: 34610
Project: 34610
Buggy source:
private CustomFormAuthenticationMechanismTest setNewAuthenticateExpectations(){
  mockery.checking(new Expectations(){
{
      one(hmc).getClientSubject();
      will(returnValue(cs));
      never(hmc).getRequest();
      never(hmc).getResponse();
    }
  }
);
  return this;
}

Fixed version (ground truth):
private CustomFormAuthenticationMechanismTest setNewAuthenticateExpectations(){
  mockery.checking(new Expectations(){
{
      never(hmc).getResponse();
    }
  }
);
  return this;
}
Program: 34611
Project: 34611
Buggy source:
private CustomFormAuthenticationMechanismTest withAuthParamsExpectations(final AuthenticationParameters ap){
  mockery.checking(new Expectations(){
{
      one(hmc).getAuthParameters();
      will(returnValue(ap));
      one(ap).isNewAuthentication();
      will(returnValue(true));
    }
  }
);
  return this;
}

Fixed version (ground truth):
private CustomFormAuthenticationMechanismTest withAuthParamsExpectations(final AuthenticationParameters ap){
  mockery.checking(new Expectations(){
{
      one(ap).isNewAuthentication();
      will(returnValue(true));
    }
  }
);
  return this;
}
Program: 34612
Project: 34612
Buggy source:
@Test public void testValidateRequestNewAuthenticateInvalidCredentialFailure() throws Exception {
  IdentityStoreHandler mish=new MyIdentityStoreHandler();
  withNewAuthenticate(coCred).withIDSBeanInstance(ids,false,false).withIDSHandlerBeanInstance(mish);
  withJaspicSessionEnabled(false);
  AuthenticationStatus status=cfam.validateRequest(request,res,hmc);
  assertEquals("String_Node_Str",AuthenticationStatus.SEND_FAILURE,status);
}

Fixed version (ground truth):
@Test public void testValidateRequestNewAuthenticateInvalidCredentialFailure() throws Exception {
  IdentityStoreHandler mish=new MyIdentityStoreHandler();
  withMessageContext(ap).withNewAuthenticate(coCred);
  withIDSBeanInstance(ids,false,false).withIDSHandlerBeanInstance(mish);
  withJaspicSessionEnabled(false);
  AuthenticationStatus status=cfam.validateRequest(request,res,hmc);
  assertEquals("String_Node_Str",AuthenticationStatus.SEND_FAILURE,status);
}
Program: 34613
Project: 34613
Buggy source:
@Test public void testValidateRequestNewAuthenticateInvalidUsernamePasswordCredFailure() throws Exception {
  IdentityStoreHandler mish=new MyIdentityStoreHandler();
  withNewAuthenticate(invalidUpCred).withIDSBeanInstance(ids,false,false).withIDSHandlerBeanInstance(mish);
  withJaspicSessionEnabled(false);
  AuthenticationStatus status=cfam.validateRequest(request,res,hmc);
  assertEquals("String_Node_Str",AuthenticationStatus.SEND_FAILURE,status);
}

Fixed version (ground truth):
@Test public void testValidateRequestNewAuthenticateInvalidUsernamePasswordCredFailure() throws Exception {
  IdentityStoreHandler mish=new MyIdentityStoreHandler();
  withMessageContext(ap).withNewAuthenticate(invalidUpCred);
  withIDSBeanInstance(ids,false,false).withIDSHandlerBeanInstance(mish);
  withJaspicSessionEnabled(false);
  AuthenticationStatus status=cfam.validateRequest(request,res,hmc);
  assertEquals("String_Node_Str",AuthenticationStatus.SEND_FAILURE,status);
}
Program: 34614
Project: 34614
Buggy source:
@SuppressWarnings("String_Node_Str") @Test public void testValidateRequestInvalidCredential() throws Exception {
  CallerOnlyCredential coc=new CallerOnlyCredential(USER1);
  withMessageContext(ap).withIsNewAuthentication(false).withGetResponse().withHandler(ch);
  withCredential(coc).withIDSBeanInstance(null,false,true);
  withJaspicSessionEnabled(false);
  try {
    AuthenticationStatus status=cfam.validateRequest(request,res,hmc);
    fail("String_Node_Str");
  }
 catch (  AuthenticationException e) {
    assertTrue("String_Node_Str",outputMgr.checkForStandardErr("String_Node_Str"));
    assertTrue("String_Node_Str",e.getMessage().contains("String_Node_Str"));
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Test public void testValidateRequestInvalidCredential() throws Exception {
  CallerOnlyCredential coc=new CallerOnlyCredential(USER1);
  withMessageContext(ap).withIsNewAuthentication(false).withGetResponse().withHandler(ch);
  withCredential(coc).withIDSBeanInstance(null,false,true);
  withJaspicSessionEnabled(false);
  try {
    cfam.validateRequest(request,res,hmc);
    fail("String_Node_Str");
  }
 catch (  AuthenticationException e) {
    assertTrue("String_Node_Str",outputMgr.checkForStandardErr("String_Node_Str"));
    assertTrue("String_Node_Str",e.getMessage().contains("String_Node_Str"));
  }
}
Program: 34615
Project: 34615
Buggy source:
@Test public void testValidateRequestValidIdAndPWNoIdentityStoreHandlerCallbackHandlerException() throws Exception {
  final String msg="String_Node_Str";
  IOException ex=new IOException(msg);
  withMessageContext(ap).withIsNewAuthentication(false).withGetResponse().withHandler(ch);
  withUsernamePassword(USER1,PASSWORD1).withIDSBeanInstance(null,true,false).withCallbackHandlerException(ex);
  withJaspicSessionEnabled(false);
  try {
    AuthenticationStatus status=cfam.validateRequest(request,res,hmc);
    fail("String_Node_Str");
  }
 catch (  AuthenticationException e) {
    assertTrue("String_Node_Str",outputMgr.checkForStandardOut("String_Node_Str"));
    assertTrue("String_Node_Str",e.getMessage().contains(msg));
  }
}

Fixed version (ground truth):
@Test public void testValidateRequestValidIdAndPWNoIdentityStoreHandlerCallbackHandlerException() throws Exception {
  final String msg="String_Node_Str";
  IOException ex=new IOException(msg);
  withMessageContext(ap).withIsNewAuthentication(false).withGetResponse().withHandler(ch);
  withUsernamePassword(USER1,PASSWORD1).withIDSBeanInstance(null,true,false).withCallbackHandlerException(ex);
  withJaspicSessionEnabled(false);
  try {
    cfam.validateRequest(request,res,hmc);
    fail("String_Node_Str");
  }
 catch (  AuthenticationException e) {
    assertTrue("String_Node_Str",outputMgr.checkForStandardOut("String_Node_Str"));
    assertTrue("String_Node_Str",e.getMessage().contains(msg));
  }
}
Program: 34616
Project: 34616
Buggy source:
@Test public void testValidateRequestWithJaspicSessionPrincipal() throws Exception {
  withMessageContext(ap).withMessageInfo().withSetStatusToResponse(HttpServletResponse.SC_OK);
  withJaspicSessionEnabled(true);
  withJaspicSessionPrincipal();
  AuthenticationStatus status=cfam.validateRequest(request,res,hmc);
  assertEquals("String_Node_Str",AuthenticationStatus.SUCCESS,status);
  assertRegisterSessionProperty(false);
}

Fixed version (ground truth):
@Test public void testValidateRequestWithJaspicSessionPrincipal() throws Exception {
  withMessageContext(ap).withMessageInfo().withGetResponse().withSetStatusToResponse(HttpServletResponse.SC_OK);
  withJaspicSessionEnabled(true);
  withJaspicSessionPrincipal();
  AuthenticationStatus status=cfam.validateRequest(request,res,hmc);
  assertEquals("String_Node_Str",AuthenticationStatus.SUCCESS,status);
  assertRegisterSessionProperty(false);
}
Program: 34617
Project: 34617
Buggy source:
@Test public void testValidateRequestNewAuthenticateBasicAuthCredSuccess() throws Exception {
  IdentityStoreHandler mish=new MyIdentityStoreHandler();
  withNewAuthenticate(baCred).withMessageInfo().withIDSBeanInstance(ids,false,false).withIDSHandlerBeanInstance(mish);
  withJaspicSessionEnabled(false);
  AuthenticationStatus status=cfam.validateRequest(request,res,hmc);
  assertEquals("String_Node_Str",AuthenticationStatus.SUCCESS,status);
}

Fixed version (ground truth):
@Test public void testValidateRequestNewAuthenticateBasicAuthCredSuccess() throws Exception {
  IdentityStoreHandler mish=new MyIdentityStoreHandler();
  withMessageContext(ap).withNewAuthenticate(baCred).withMessageInfo();
  withIDSBeanInstance(ids,false,false).withIDSHandlerBeanInstance(mish);
  withJaspicSessionEnabled(false);
  AuthenticationStatus status=cfam.validateRequest(request,res,hmc);
  assertEquals("String_Node_Str",AuthenticationStatus.SUCCESS,status);
}
Program: 34618
Project: 34618
Buggy source:
private FormAuthenticationMechanismTest withMessageContext() throws Exception {
  mockery.checking(new Expectations(){
{
      allowing(hmc).getClientSubject();
      will(returnValue(cs));
      one(hmc).getAuthParameters();
      will(returnValue(null));
      allowing(hmc).getRequest();
      will(returnValue(request));
      allowing(hmc).getResponse();
      will(returnValue(res));
    }
  }
);
  return this;
}

Fixed version (ground truth):
private FormAuthenticationMechanismTest withMessageContext() throws Exception {
  mockery.checking(new Expectations(){
{
      allowing(hmc).getClientSubject();
      will(returnValue(cs));
      allowing(hmc).getRequest();
      will(returnValue(request));
      allowing(hmc).getResponse();
      will(returnValue(res));
    }
  }
);
  return this;
}
Program: 34619
Project: 34619
Buggy source:
private FormAuthenticationMechanismTest withNewAuthenticate(Credential cred){
  setNewAuthenticateExpectations().withAuthParamsExpectations(ap).withCredentialExpectations(cred);
  return this;
}

Fixed version (ground truth):
private FormAuthenticationMechanismTest withNewAuthenticate(Credential cred) throws Exception {
  withMessageContext().setNewAuthenticateExpectations().withAuthParamsExpectations(ap).withCredentialExpectations(cred);
  withJaspicSessionEnabled(false);
  return this;
}
Program: 34620
Project: 34620
Buggy source:
private FormAuthenticationMechanismTest withAuthenticationRequest(final boolean value) throws Exception {
  mockery.checking(new Expectations(){
{
      one(hmc).isAuthenticationRequest();
      will(returnValue(value));
    }
  }
);
  return this;
}

Fixed version (ground truth):
private FormAuthenticationMechanismTest withAuthenticationRequest(final boolean value) throws Exception {
  mockery.checking(new Expectations(){
{
      one(hmc).isAuthenticationRequest();
      will(returnValue(value));
    }
  }
);
  if (value == false) {
    withAuthParamsExpectations(null);
  }
 else {
    withAuthParamsExpectations(ap).withCredentialExpectations(null);
  }
  return this;
}
Program: 34621
Project: 34621
Buggy source:
private FormAuthenticationMechanismTest setNewAuthenticateExpectations(){
  mockery.checking(new Expectations(){
{
      one(hmc).getClientSubject();
      will(returnValue(cs));
      never(hmc).getRequest();
      never(hmc).getResponse();
    }
  }
);
  return this;
}

Fixed version (ground truth):
private FormAuthenticationMechanismTest setNewAuthenticateExpectations(){
  mockery.checking(new Expectations(){
{
      never(hmc).getResponse();
    }
  }
);
  return this;
}
Program: 34622
Project: 34622
Buggy source:
protected ModulePropertiesProvider getModulePropertiesProvider(){
  Instance<ModulePropertiesProvider> modulePropertiesProivderInstance=getCDI().select(ModulePropertiesProvider.class);
  if (modulePropertiesProivderInstance != null) {
    return modulePropertiesProivderInstance.get();
  }
  return null;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected ModulePropertiesProvider getModulePropertiesProvider(){
  Instance<ModulePropertiesProvider> modulePropertiesProivderInstance=getCDI().select(ModulePropertiesProvider.class);
  if (modulePropertiesProivderInstance != null) {
    return modulePropertiesProivderInstance.get();
  }
  return null;
}
Program: 34623
Project: 34623
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private AuthenticationStatus handleAuthorizationHeader(@Sensitive String authorizationHeader,Subject clientSubject,HttpMessageContext httpMessageContext) throws AuthenticationException {
  AuthenticationStatus status=AuthenticationStatus.SEND_FAILURE;
  int rspStatus=HttpServletResponse.SC_FORBIDDEN;
  if (authorizationHeader.startsWith("String_Node_Str")) {
    String encodedHeader=authorizationHeader.substring(6);
    String basicAuthHeader=decodeCookieString(encodedHeader);
    if (isAuthorizationHeaderValid(basicAuthHeader)) {
      BasicAuthenticationCredential basicAuthCredential=new BasicAuthenticationCredential(encodedHeader);
      status=utils.validateUserAndPassword(getCDI(),realmName,clientSubject,basicAuthCredential,httpMessageContext);
      if (status == AuthenticationStatus.SUCCESS) {
        Map messageInfoMap=httpMessageContext.getMessageInfo().getMap();
        messageInfoMap.put("String_Node_Str","String_Node_Str");
        if (isJaspicSessionForMechanismsEnabled(httpMessageContext)) {
          messageInfoMap.put("String_Node_Str",Boolean.TRUE.toString());
        }
        rspStatus=HttpServletResponse.SC_OK;
      }
 else       if (status == AuthenticationStatus.NOT_DONE) {
        rspStatus=HttpServletResponse.SC_OK;
      }
    }
  }
  httpMessageContext.getResponse().setStatus(rspStatus);
  return status;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private AuthenticationStatus handleAuthorizationHeader(@Sensitive String authorizationHeader,Subject clientSubject,HttpMessageContext httpMessageContext) throws AuthenticationException {
  AuthenticationStatus status=AuthenticationStatus.SEND_FAILURE;
  int rspStatus=HttpServletResponse.SC_FORBIDDEN;
  if (authorizationHeader.startsWith("String_Node_Str")) {
    String encodedHeader=authorizationHeader.substring(6);
    String basicAuthHeader=decodeCookieString(encodedHeader);
    if (isAuthorizationHeaderValid(basicAuthHeader)) {
      BasicAuthenticationCredential basicAuthCredential=new BasicAuthenticationCredential(encodedHeader);
      status=utils.validateUserAndPassword(getCDI(),realmName,clientSubject,basicAuthCredential,httpMessageContext);
      if (status == AuthenticationStatus.SUCCESS) {
        Map messageInfoMap=httpMessageContext.getMessageInfo().getMap();
        messageInfoMap.put("String_Node_Str","String_Node_Str");
        if (isJaspicSessionForMechanismsEnabled(httpMessageContext)) {
          messageInfoMap.put("String_Node_Str",Boolean.TRUE.toString());
          setCacheKey(clientSubject);
        }
        rspStatus=HttpServletResponse.SC_OK;
      }
 else       if (status == AuthenticationStatus.NOT_DONE) {
        rspStatus=HttpServletResponse.SC_OK;
      }
    }
  }
  httpMessageContext.getResponse().setStatus(rspStatus);
  return status;
}
Program: 34624
Project: 34624
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private AuthenticationStatus handleFormLogin(@Sensitive Credential credential,HttpServletResponse rsp,Subject clientSubject,HttpMessageContext httpMessageContext) throws AuthenticationException {
  AuthenticationStatus status=utils.handleAuthenticate(getCDI(),JavaEESecConstants.DEFAULT_REALM,credential,clientSubject,httpMessageContext);
  int rspStatus;
  if (status == AuthenticationStatus.SUCCESS) {
    Map messageInfoMap=httpMessageContext.getMessageInfo().getMap();
    messageInfoMap.put("String_Node_Str","String_Node_Str");
    if (isJaspicSessionForMechanismsEnabled(httpMessageContext)) {
      messageInfoMap.put("String_Node_Str",Boolean.TRUE.toString());
    }
    rspStatus=HttpServletResponse.SC_OK;
  }
 else   if (status == AuthenticationStatus.NOT_DONE) {
    rspStatus=HttpServletResponse.SC_OK;
  }
 else {
    rspStatus=HttpServletResponse.SC_FORBIDDEN;
  }
  if (rsp != null) {
    rsp.setStatus(rspStatus);
  }
  return status;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private AuthenticationStatus handleFormLogin(@Sensitive Credential credential,HttpServletResponse rsp,Subject clientSubject,HttpMessageContext httpMessageContext) throws AuthenticationException {
  AuthenticationStatus status=utils.handleAuthenticate(getCDI(),JavaEESecConstants.DEFAULT_REALM,credential,clientSubject,httpMessageContext);
  int rspStatus;
  if (status == AuthenticationStatus.SUCCESS) {
    Map messageInfoMap=httpMessageContext.getMessageInfo().getMap();
    messageInfoMap.put("String_Node_Str","String_Node_Str");
    if (isJaspicSessionForMechanismsEnabled(httpMessageContext)) {
      messageInfoMap.put("String_Node_Str",Boolean.TRUE.toString());
      setCacheKey(clientSubject);
    }
    rspStatus=HttpServletResponse.SC_OK;
  }
 else   if (status == AuthenticationStatus.NOT_DONE) {
    rspStatus=HttpServletResponse.SC_OK;
  }
 else {
    rspStatus=HttpServletResponse.SC_FORBIDDEN;
  }
  if (rsp != null) {
    rsp.setStatus(rspStatus);
  }
  return status;
}
Program: 34625
Project: 34625
Buggy source:
/** 
 * note that both username and password should not be null.
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private AuthenticationStatus handleFormLogin(String username,@Sensitive String password,HttpServletResponse rsp,Subject clientSubject,HttpMessageContext httpMessageContext) throws AuthenticationException {
  AuthenticationStatus status=AuthenticationStatus.SEND_FAILURE;
  int rspStatus=HttpServletResponse.SC_FORBIDDEN;
  UsernamePasswordCredential credential=new UsernamePasswordCredential(username,password);
  status=utils.validateUserAndPassword(getCDI(),JavaEESecConstants.DEFAULT_REALM,clientSubject,credential,httpMessageContext);
  if (status == AuthenticationStatus.SUCCESS) {
    Map messageInfoMap=httpMessageContext.getMessageInfo().getMap();
    messageInfoMap.put("String_Node_Str","String_Node_Str");
    if (isJaspicSessionForMechanismsEnabled(httpMessageContext)) {
      messageInfoMap.put("String_Node_Str",Boolean.TRUE.toString());
    }
    rspStatus=HttpServletResponse.SC_OK;
  }
 else   if (status == AuthenticationStatus.NOT_DONE) {
    rspStatus=HttpServletResponse.SC_OK;
  }
 else {
  }
  rsp.setStatus(rspStatus);
  return status;
}

Fixed version (ground truth):
/** 
 * note that both username and password should not be null.
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private AuthenticationStatus handleFormLogin(String username,@Sensitive String password,HttpServletResponse rsp,Subject clientSubject,HttpMessageContext httpMessageContext) throws AuthenticationException {
  AuthenticationStatus status=AuthenticationStatus.SEND_FAILURE;
  int rspStatus=HttpServletResponse.SC_FORBIDDEN;
  UsernamePasswordCredential credential=new UsernamePasswordCredential(username,password);
  status=utils.validateUserAndPassword(getCDI(),JavaEESecConstants.DEFAULT_REALM,clientSubject,credential,httpMessageContext);
  if (status == AuthenticationStatus.SUCCESS) {
    Map messageInfoMap=httpMessageContext.getMessageInfo().getMap();
    messageInfoMap.put("String_Node_Str","String_Node_Str");
    if (isJaspicSessionForMechanismsEnabled(httpMessageContext)) {
      messageInfoMap.put("String_Node_Str",Boolean.TRUE.toString());
      setCacheKey(clientSubject);
    }
    rspStatus=HttpServletResponse.SC_OK;
  }
 else   if (status == AuthenticationStatus.NOT_DONE) {
    rspStatus=HttpServletResponse.SC_OK;
  }
 else {
  }
  rsp.setStatus(rspStatus);
  return status;
}
Program: 34626
Project: 34626
Buggy source:
protected AuthenticationStatus validateUserAndPassword(CDI cdi,String realmName,Subject clientSubject,@Sensitive UsernamePasswordCredential credential,HttpMessageContext httpMessageContext) throws AuthenticationException {
  return validateCredential(cdi,realmName,clientSubject,credential,httpMessageContext);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected AuthenticationStatus validateUserAndPassword(CDI cdi,String realmName,Subject clientSubject,@Sensitive UsernamePasswordCredential credential,HttpMessageContext httpMessageContext) throws AuthenticationException {
  return validateCredential(cdi,realmName,clientSubject,credential,httpMessageContext);
}
Program: 34627
Project: 34627
Buggy source:
@SuppressWarnings("String_Node_Str") public IdentityStoreHandler getIdentityStoreHandler(CDI cdi){
  IdentityStoreHandler identityStoreHandler=null;
  Instance<IdentityStoreHandler> storeHandlerInstance=cdi.select(IdentityStoreHandler.class);
  if (storeHandlerInstance.isUnsatisfied() == false && storeHandlerInstance.isAmbiguous() == false) {
    identityStoreHandler=storeHandlerInstance.get();
  }
  if (identityStoreHandler == null && cdi.getBeanManager().equals(CDIHelper.getBeanManager()) == false) {
    identityStoreHandler=(IdentityStoreHandler)CDIHelper.getBeanFromCurrentModule(IdentityStoreHandler.class);
  }
  return identityStoreHandler;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public IdentityStoreHandler getIdentityStoreHandler(CDI cdi){
  IdentityStoreHandler identityStoreHandler=null;
  Instance<IdentityStoreHandler> storeHandlerInstance=cdi.select(IdentityStoreHandler.class);
  if (storeHandlerInstance.isUnsatisfied() == false && storeHandlerInstance.isAmbiguous() == false) {
    identityStoreHandler=storeHandlerInstance.get();
  }
  if (identityStoreHandler == null && cdi.getBeanManager().equals(CDIHelper.getBeanManager()) == false) {
    identityStoreHandler=(IdentityStoreHandler)CDIHelper.getBeanFromCurrentModule(IdentityStoreHandler.class);
  }
  return identityStoreHandler;
}
Program: 34628
Project: 34628
Buggy source:
private void setLoginHashtable(String realmName,Subject clientSubject,CredentialValidationResult result){
  Hashtable<String,Object> subjectHashtable=getSubjectHashtable(clientSubject);
  String callerPrincipalName=result.getCallerPrincipal().getName();
  String callerUniqueId=result.getCallerUniqueId();
  String realm=result.getIdentityStoreId();
  realm=realm != null ? realm : realmName;
  String uniqueId=callerUniqueId != null ? callerUniqueId : callerPrincipalName;
  setCommonAttributes(subjectHashtable,realm,callerPrincipalName);
  setUniqueIdAndCacheKey(subjectHashtable,realm,uniqueId);
  setGroups(subjectHashtable,result.getCallerGroups());
}

Fixed version (ground truth):
private void setLoginHashtable(String realmName,Subject clientSubject,CredentialValidationResult result){
  Hashtable<String,Object> subjectHashtable=getSubjectHashtable(clientSubject);
  String callerPrincipalName=result.getCallerPrincipal().getName();
  String callerUniqueId=result.getCallerUniqueId();
  String realm=result.getIdentityStoreId();
  realm=realm != null ? realm : realmName;
  String uniqueId=callerUniqueId != null ? callerUniqueId : callerPrincipalName;
  setCommonAttributes(subjectHashtable,realm,callerPrincipalName);
  setUniqueId(subjectHashtable,realm,uniqueId);
  setGroups(subjectHashtable,result.getCallerGroups());
}
Program: 34629
Project: 34629
Buggy source:
@SuppressWarnings("String_Node_Str") public boolean isIdentityStoreAvailable(CDI cdi){
  Instance<IdentityStore> identityStoreInstances=cdi.select(IdentityStore.class);
  if (identityStoreInstances != null && !identityStoreInstances.isUnsatisfied() && !identityStoreInstances.isAmbiguous()) {
    return true;
  }
  if (cdi.getBeanManager().equals(CDIHelper.getBeanManager()) == false) {
    if (!CDIHelper.getBeansFromCurrentModule(IdentityStore.class).isEmpty()) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public boolean isIdentityStoreAvailable(CDI cdi){
  Instance<IdentityStore> identityStoreInstances=cdi.select(IdentityStore.class);
  if (identityStoreInstances != null && !identityStoreInstances.isUnsatisfied() && !identityStoreInstances.isAmbiguous()) {
    return true;
  }
  if (cdi.getBeanManager().equals(CDIHelper.getBeanManager()) == false) {
    if (!CDIHelper.getBeansFromCurrentModule(IdentityStore.class).isEmpty()) {
      return true;
    }
  }
  return false;
}
Program: 34630
Project: 34630
Buggy source:
protected AuthenticationStatus validateCredential(CDI cdi,String realmName,Subject clientSubject,@Sensitive Credential credential,HttpMessageContext httpMessageContext) throws AuthenticationException {
  AuthenticationStatus status=AuthenticationStatus.SEND_FAILURE;
  if (isIdentityStoreAvailable(cdi)) {
    IdentityStoreHandler identityStoreHandler=getIdentityStoreHandler(cdi);
    if (identityStoreHandler != null) {
      status=validateWithIdentityStore(realmName,clientSubject,credential,identityStoreHandler);
    }
 else {
      if (tc.isDebugEnabled()) {
        Tr.debug(tc,"String_Node_Str");
      }
      throw new AuthenticationException("String_Node_Str");
    }
  }
 else {
    if (!logNoIDWarning) {
      Tr.warning(tc,"String_Node_Str");
      logNoIDWarning=true;
    }
    if (isRegistryAvailable()) {
      status=validateWithUserRegistry(clientSubject,credential,httpMessageContext.getHandler());
    }
 else {
      status=AuthenticationStatus.NOT_DONE;
    }
  }
  return status;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected AuthenticationStatus validateCredential(CDI cdi,String realmName,Subject clientSubject,@Sensitive Credential credential,HttpMessageContext httpMessageContext) throws AuthenticationException {
  AuthenticationStatus status=AuthenticationStatus.SEND_FAILURE;
  if (isIdentityStoreAvailable(cdi)) {
    IdentityStoreHandler identityStoreHandler=getIdentityStoreHandler(cdi);
    if (identityStoreHandler != null) {
      status=validateWithIdentityStore(realmName,clientSubject,credential,identityStoreHandler);
    }
 else {
      if (tc.isDebugEnabled()) {
        Tr.debug(tc,"String_Node_Str");
      }
      throw new AuthenticationException("String_Node_Str");
    }
  }
 else {
    if (!logNoIDWarning) {
      Tr.warning(tc,"String_Node_Str");
      logNoIDWarning=true;
    }
    if (isRegistryAvailable()) {
      status=validateWithUserRegistry(clientSubject,credential,httpMessageContext.getHandler());
    }
 else {
      status=AuthenticationStatus.NOT_DONE;
    }
  }
  return status;
}
Program: 34631
Project: 34631
Buggy source:
protected AuthenticationStatus handleAuthenticate(CDI cdi,String realmName,@Sensitive Credential credential,Subject clientSubject,HttpMessageContext httpMessageContext) throws AuthenticationException {
  AuthenticationStatus status=AuthenticationStatus.SEND_FAILURE;
  status=validateCredential(cdi,realmName,clientSubject,credential,httpMessageContext);
  if (status == AuthenticationStatus.SUCCESS) {
    httpMessageContext.getMessageInfo().getMap().put("String_Node_Str","String_Node_Str");
  }
  return status;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) protected AuthenticationStatus handleAuthenticate(CDI cdi,String realmName,@Sensitive Credential credential,Subject clientSubject,HttpMessageContext httpMessageContext) throws AuthenticationException {
  AuthenticationStatus status=AuthenticationStatus.SEND_FAILURE;
  status=validateCredential(cdi,realmName,clientSubject,credential,httpMessageContext);
  if (status == AuthenticationStatus.SUCCESS) {
    httpMessageContext.getMessageInfo().getMap().put("String_Node_Str","String_Node_Str");
  }
  return status;
}
Program: 34632
Project: 34632
Buggy source:
private Hashtable<String,Object> getSubjectExistingHashtable(final Subject clientSubject){
  if (clientSubject == null) {
    return null;
  }
  PrivilegedAction<Hashtable<String,Object>> action=new PrivilegedAction<Hashtable<String,Object>>(){
    @SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public Hashtable<String,Object> run(){
      Set hashtables=clientSubject.getPrivateCredentials(Hashtable.class);
      if (hashtables == null || hashtables.isEmpty()) {
        if (tc.isDebugEnabled()) {
          Tr.debug(tc,"String_Node_Str");
        }
        return null;
      }
 else {
        Hashtable hashtable=(Hashtable)hashtables.iterator().next();
        return hashtable;
      }
    }
  }
;
  Hashtable<String,Object> cred=AccessController.doPrivileged(action);
  return cred;
}

Fixed version (ground truth):
public Hashtable<String,Object> getSubjectExistingHashtable(final Subject clientSubject){
  if (clientSubject == null) {
    return null;
  }
  PrivilegedAction<Hashtable<String,Object>> action=new PrivilegedAction<Hashtable<String,Object>>(){
    @SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public Hashtable<String,Object> run(){
      Set hashtables=clientSubject.getPrivateCredentials(Hashtable.class);
      if (hashtables == null || hashtables.isEmpty()) {
        if (tc.isDebugEnabled()) {
          Tr.debug(tc,"String_Node_Str");
        }
        return null;
      }
 else {
        Hashtable hashtable=(Hashtable)hashtables.iterator().next();
        return hashtable;
      }
    }
  }
;
  Hashtable<String,Object> cred=AccessController.doPrivileged(action);
  return cred;
}
Program: 34633
Project: 34633
Buggy source:
@SuppressWarnings("String_Node_Str") private void assertSubjectContents(String realmName,String uniqueId){
  Hashtable<String,?> customProperties=getSubjectHashtable();
  assertEquals("String_Node_Str",Boolean.TRUE,customProperties.get(AuthenticationConstants.INTERNAL_ASSERTION_KEY));
  assertEquals("String_Node_Str","String_Node_Str" + realmName + "String_Node_Str"+ uniqueId,customProperties.get(AttributeNameConstants.WSCREDENTIAL_UNIQUEID));
  assertEquals("String_Node_Str",principalName,customProperties.get(AttributeNameConstants.WSCREDENTIAL_USERID));
  assertEquals("String_Node_Str",principalName,customProperties.get(AttributeNameConstants.WSCREDENTIAL_SECURITYNAME));
  List<String> subjectGroups=(List<String>)customProperties.get(AttributeNameConstants.WSCREDENTIAL_GROUPS);
  assertTrue("String_Node_Str",groups.containsAll(subjectGroups) && subjectGroups.containsAll(groups));
  assertEquals("String_Node_Str",realmName,customProperties.get(AttributeNameConstants.WSCREDENTIAL_REALM));
  assertNotNull("String_Node_Str",customProperties.get(AttributeNameConstants.WSCREDENTIAL_CACHE_KEY));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void assertSubjectContents(String realmName,String uniqueId){
  Hashtable<String,?> customProperties=getSubjectHashtable();
  assertEquals("String_Node_Str",Boolean.TRUE,customProperties.get(AuthenticationConstants.INTERNAL_ASSERTION_KEY));
  assertEquals("String_Node_Str","String_Node_Str" + realmName + "String_Node_Str"+ uniqueId,customProperties.get(AttributeNameConstants.WSCREDENTIAL_UNIQUEID));
  assertEquals("String_Node_Str",principalName,customProperties.get(AttributeNameConstants.WSCREDENTIAL_USERID));
  assertEquals("String_Node_Str",principalName,customProperties.get(AttributeNameConstants.WSCREDENTIAL_SECURITYNAME));
  List<String> subjectGroups=(List<String>)customProperties.get(AttributeNameConstants.WSCREDENTIAL_GROUPS);
  assertTrue("String_Node_Str",groups.containsAll(subjectGroups) && subjectGroups.containsAll(groups));
  assertEquals("String_Node_Str",realmName,customProperties.get(AttributeNameConstants.WSCREDENTIAL_REALM));
}
Program: 34634
Project: 34634
Buggy source:
@SuppressWarnings("String_Node_Str") private void assertSubjectContents(Subject subject,String realmName,String uniqueId){
  Hashtable<String,?> customProperties=getSubjectHashtable(subject);
  assertEquals("String_Node_Str",Boolean.TRUE,customProperties.get(AuthenticationConstants.INTERNAL_ASSERTION_KEY));
  assertEquals("String_Node_Str","String_Node_Str" + realmName + "String_Node_Str"+ uniqueId,customProperties.get(AttributeNameConstants.WSCREDENTIAL_UNIQUEID));
  assertEquals("String_Node_Str",principalName,customProperties.get(AttributeNameConstants.WSCREDENTIAL_USERID));
  assertEquals("String_Node_Str",principalName,customProperties.get(AttributeNameConstants.WSCREDENTIAL_SECURITYNAME));
  List<String> subjectGroups=(List<String>)customProperties.get(AttributeNameConstants.WSCREDENTIAL_GROUPS);
  assertTrue("String_Node_Str",groups.containsAll(subjectGroups) && subjectGroups.containsAll(groups));
  assertEquals("String_Node_Str",realmName,customProperties.get(AttributeNameConstants.WSCREDENTIAL_REALM));
  assertNotNull("String_Node_Str",customProperties.get(AttributeNameConstants.WSCREDENTIAL_CACHE_KEY));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void assertSubjectContents(Subject subject,String realmName,String uniqueId){
  Hashtable<String,?> customProperties=getSubjectHashtable(subject);
  assertEquals("String_Node_Str",Boolean.TRUE,customProperties.get(AuthenticationConstants.INTERNAL_ASSERTION_KEY));
  assertEquals("String_Node_Str","String_Node_Str" + realmName + "String_Node_Str"+ uniqueId,customProperties.get(AttributeNameConstants.WSCREDENTIAL_UNIQUEID));
  assertEquals("String_Node_Str",principalName,customProperties.get(AttributeNameConstants.WSCREDENTIAL_USERID));
  assertEquals("String_Node_Str",principalName,customProperties.get(AttributeNameConstants.WSCREDENTIAL_SECURITYNAME));
  List<String> subjectGroups=(List<String>)customProperties.get(AttributeNameConstants.WSCREDENTIAL_GROUPS);
  assertTrue("String_Node_Str",groups.containsAll(subjectGroups) && subjectGroups.containsAll(groups));
  assertEquals("String_Node_Str",realmName,customProperties.get(AttributeNameConstants.WSCREDENTIAL_REALM));
  assertNull("String_Node_Str",customProperties.get(AttributeNameConstants.WSCREDENTIAL_CACHE_KEY));
}
Program: 34635
Project: 34635
Buggy source:
/** 
 * Evaluate and return the groupSearchFilter.
 * @param immediateOnly If true, only return a non-null value if the setting is either animmediate EL expression or not set by an EL expression. If false, return the value regardless of where it is evaluated.
 * @return The groupSearchFilter or null if immediateOnly==true AND the value is not evaluatedfrom a deferred EL expression.
 */
@FFDCIgnore(IllegalArgumentException.class) private String evaluateGroupSearchFilter(boolean immediateOnly){
  try {
    String result=ELHelper.processString("String_Node_Str",this.idStoreDefinition.groupSearchFilter(),immediateOnly);
    if (result == null || result.isEmpty()) {
      if (isCTS()) {
        Tr.debug(tc,"String_Node_Str");
        return "String_Node_Str";
      }
    }
    return result;
  }
 catch (  IllegalArgumentException e) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isWarningEnabled()) {
      Tr.warning(tc,"String_Node_Str",new Object[]{"String_Node_Str","String_Node_Str"});
    }
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
/** 
 * Evaluate and return the groupSearchFilter.
 * @param immediateOnly If true, only return a non-null value if the setting is either animmediate EL expression or not set by an EL expression. If false, return the value regardless of where it is evaluated.
 * @return The groupSearchFilter or null if immediateOnly==true AND the value is not evaluatedfrom a deferred EL expression.
 */
@FFDCIgnore(IllegalArgumentException.class) private String evaluateGroupSearchFilter(boolean immediateOnly){
  try {
    final String result=ELHelper.processString("String_Node_Str",this.idStoreDefinition.groupSearchFilter(),immediateOnly);
    if (result == null || result.isEmpty()) {
      if (isCTS()) {
        Tr.debug(tc,"String_Node_Str");
        return "String_Node_Str";
      }
    }
    return result;
  }
 catch (  IllegalArgumentException e) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isWarningEnabled()) {
      Tr.warning(tc,"String_Node_Str",new Object[]{"String_Node_Str","String_Node_Str"});
    }
    return "String_Node_Str";
  }
}
Program: 34636
Project: 34636
Buggy source:
@Test public void testValidateRequestRegistersJaspicSession() throws Exception {
  withMessageContext(ap).withMessageInfo().withGetResponse();
  withUsernamePassword(USER1,PASSWORD1).withIsNewAuthentication(false);
  withIDSBeanInstance(ids,false,false).withSetStatusToResponse(HttpServletResponse.SC_OK);
  withJaspicSessionEnabled(true);
  withoutJaspicSessionPrincipal();
  AuthenticationStatus status=cfam.validateRequest(request,res,hmc);
  assertEquals("String_Node_Str",AuthenticationStatus.SUCCESS,status);
  assertRegisterSessionProperty(true);
}

Fixed version (ground truth):
@Test public void testValidateRequestRegistersJaspicSession() throws Exception {
  IdentityStoreHandler mish=new MyIdentityStoreHandler();
  withMessageContext(ap).withMessageInfo().withGetResponse();
  withUsernamePassword(USER1,PASSWORD1).withIsNewAuthentication(false);
  withIDSBeanInstance(ids,false,false).withIDSHandlerBeanInstance(mish).withSetStatusToResponse(HttpServletResponse.SC_OK);
  withJaspicSessionEnabled(true);
  withoutJaspicSessionPrincipal();
  AuthenticationStatus status=cfam.validateRequest(request,res,hmc);
  assertEquals("String_Node_Str",AuthenticationStatus.SUCCESS,status);
  assertRegisterSessionProperty(true);
}
Program: 34637
Project: 34637
Buggy source:
private boolean isRegistryAvailable(){
  try {
    return (RegistryHelper.getUserRegistry(null) != null);
  }
 catch (  WSSecurityException e) {
    if (tc.isDebugEnabled())     Tr.debug(tc,"String_Node_Str",e);
    return true;
  }
}

Fixed version (ground truth):
protected boolean isRegistryAvailable(){
  try {
    return (RegistryHelper.getUserRegistry(null) != null);
  }
 catch (  WSSecurityException e) {
    if (tc.isDebugEnabled())     Tr.debug(tc,"String_Node_Str",e);
    return true;
  }
}
Program: 34639
Project: 34639
Buggy source:
@SuppressWarnings("String_Node_Str") @Before public void setUp() throws Exception {
  cdi=mockery.mock(CDI.class);
  iis=mockery.mock(Instance.class,"String_Node_Str");
  iish=mockery.mock(Instance.class,"String_Node_Str");
  ids=mockery.mock(IdentityStore.class);
  bm=mockery.mock(BeanManager.class,"String_Node_Str");
  ap=mockery.mock(AuthenticationParameters.class);
  hmc=mockery.mock(HttpMessageContext.class);
  mi=mockery.mock(MessageInfo.class);
  req=mockery.mock(HttpServletRequest.class);
  res=mockery.mock(HttpServletResponse.class);
  ch=mockery.mock(CallbackHandler.class);
  cs=new Subject();
  cdis=mockery.mock(CDIService.class);
  cdiHelperTestWrapper=new CDIHelperTestWrapper(mockery,null);
  cdiHelperTestWrapper.setCDIService(cdis);
  cfam=new CustomFormAuthenticationMechanism(){
    @SuppressWarnings("String_Node_Str") @Override protected CDI getCDI(){
      return cdi;
    }
  }
;
  coCred=new CallerOnlyCredential(USER1);
  upCred=new UsernamePasswordCredential(USER1,PASSWORD1);
  invalidUpCred=new UsernamePasswordCredential(USER1,INVALID_PASSWORD);
  baCred=new BasicAuthenticationCredential(Base64Coder.base64Encode(USER1 + "String_Node_Str" + PASSWORD1));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Before public void setUp() throws Exception {
  cdi=mockery.mock(CDI.class);
  iis=mockery.mock(Instance.class,"String_Node_Str");
  iish=mockery.mock(Instance.class,"String_Node_Str");
  ids=mockery.mock(IdentityStore.class);
  bm=mockery.mock(BeanManager.class,"String_Node_Str");
  ap=mockery.mock(AuthenticationParameters.class);
  hmc=mockery.mock(HttpMessageContext.class);
  mi=mockery.mock(MessageInfo.class);
  req=mockery.mock(HttpServletRequest.class);
  res=mockery.mock(HttpServletResponse.class);
  ch=mockery.mock(CallbackHandler.class);
  cs=new Subject();
  cdis=mockery.mock(CDIService.class);
  cdiHelperTestWrapper=new CDIHelperTestWrapper(mockery,null);
  cdiHelperTestWrapper.setCDIService(cdis);
  Utils utils=new Utils(){
    @Override protected boolean isRegistryAvailable(){
      return isRegistryAvailable;
    }
  }
;
  cfam=new CustomFormAuthenticationMechanism(utils){
    @SuppressWarnings("String_Node_Str") @Override protected CDI getCDI(){
      return cdi;
    }
  }
;
  coCred=new CallerOnlyCredential(USER1);
  upCred=new UsernamePasswordCredential(USER1,PASSWORD1);
  invalidUpCred=new UsernamePasswordCredential(USER1,INVALID_PASSWORD);
  baCred=new BasicAuthenticationCredential(Base64Coder.base64Encode(USER1 + "String_Node_Str" + PASSWORD1));
}
Program: 34640
Project: 34640
Buggy source:
@SuppressWarnings("String_Node_Str") @Before public void setUp() throws Exception {
  cdi=mockery.mock(CDI.class);
  iis=mockery.mock(Instance.class,"String_Node_Str");
  iish=mockery.mock(Instance.class);
  ids=mockery.mock(IdentityStore.class);
  bm=mockery.mock(BeanManager.class,"String_Node_Str");
  ap=mockery.mock(AuthenticationParameters.class);
  hmc=mockery.mock(HttpMessageContext.class);
  mi=mockery.mock(MessageInfo.class);
  req=mockery.mock(HttpServletRequest.class);
  res=mockery.mock(HttpServletResponse.class);
  ch=mockery.mock(CallbackHandler.class);
  cs=new Subject();
  cdis=mockery.mock(CDIService.class);
  cdiHelperTestWrapper=new CDIHelperTestWrapper(mockery,null);
  cdiHelperTestWrapper.setCDIService(cdis);
  fam=new FormAuthenticationMechanism(){
    @SuppressWarnings("String_Node_Str") @Override protected CDI getCDI(){
      return cdi;
    }
  }
;
  coCred=new CallerOnlyCredential(USER1);
  upCred=new UsernamePasswordCredential(USER1,PASSWORD1);
  invalidUpCred=new UsernamePasswordCredential(USER1,INVALID_PASSWORD);
  baCred=new BasicAuthenticationCredential(Base64Coder.base64Encode(USER1 + "String_Node_Str" + PASSWORD1));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Before public void setUp() throws Exception {
  cdi=mockery.mock(CDI.class);
  iis=mockery.mock(Instance.class,"String_Node_Str");
  iish=mockery.mock(Instance.class);
  ids=mockery.mock(IdentityStore.class);
  bm=mockery.mock(BeanManager.class,"String_Node_Str");
  ap=mockery.mock(AuthenticationParameters.class);
  hmc=mockery.mock(HttpMessageContext.class);
  mi=mockery.mock(MessageInfo.class);
  req=mockery.mock(HttpServletRequest.class);
  res=mockery.mock(HttpServletResponse.class);
  ch=mockery.mock(CallbackHandler.class);
  cs=new Subject();
  cdis=mockery.mock(CDIService.class);
  cdiHelperTestWrapper=new CDIHelperTestWrapper(mockery,null);
  cdiHelperTestWrapper.setCDIService(cdis);
  Utils utils=new Utils(){
    @Override protected boolean isRegistryAvailable(){
      return isRegistryAvailable;
    }
  }
;
  fam=new FormAuthenticationMechanism(utils){
    @SuppressWarnings("String_Node_Str") @Override protected CDI getCDI(){
      return cdi;
    }
  }
;
  coCred=new CallerOnlyCredential(USER1);
  upCred=new UsernamePasswordCredential(USER1,PASSWORD1);
  invalidUpCred=new UsernamePasswordCredential(USER1,INVALID_PASSWORD);
  baCred=new BasicAuthenticationCredential(Base64Coder.base64Encode(USER1 + "String_Node_Str" + PASSWORD1));
}
Program: 34642
Project: 34642
Buggy source:
@Override public void setApplication(Application application){
synchronized (this) {
    _applicationFactory.setApplication(application);
  }
}

Fixed version (ground truth):
@Override public void setApplication(Application application){
synchronized (this) {
    if (application == null) {
      throw new NullPointerException("String_Node_Str");
    }
    _application=application;
  }
}