nus-yam/ex-repair huggingface dataset:
Program: 34894
Project: 34894
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: 34895
Project: 34895
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: 34896
Project: 34896
Buggy source:
private void setRealmName(){
  if (mpp != null) {
    Properties props=mpp.getAuthMechProperties(BasicHttpAuthenticationMechanism.class);
    if (props != null) {
      realmName=(String)props.get(JavaEESecConstants.REALM_NAME);
    }
  }
  if (realmName == null || realmName.trim().isEmpty()) {
    Tr.warning(tc,"String_Node_Str");
    realmName=DEFAULT_REALM;
  }
}

Fixed version (ground truth):
private void setRealmName(){
  mpp=getModulePropertiesProvider();
  if (mpp != null) {
    Properties props=mpp.getAuthMechProperties(BasicHttpAuthenticationMechanism.class);
    if (props != null) {
      realmName=(String)props.get(JavaEESecConstants.REALM_NAME);
    }
  }
  if (realmName == null || realmName.trim().isEmpty()) {
    Tr.warning(tc,"String_Node_Str");
    realmName=DEFAULT_REALM;
  }
}
Program: 34897
Project: 34897
Buggy source:
@PostConstruct public void initialize(InvocationContext ic){
  if (mpp != null) {
    Class hamClass=getTargetClass(ic);
    initializeUseForwardToLogin(mpp.getAuthMechProperties(hamClass),isCustomHAM(hamClass));
  }
 else {
    Tr.error(tc,"String_Node_Str");
  }
}

Fixed version (ground truth):
@PostConstruct public void initialize(InvocationContext ic){
  mpp=getModulePropertiesProvider();
  if (mpp != null) {
    Class hamClass=getTargetClass(ic);
    initializeUseForwardToLogin(mpp.getAuthMechProperties(hamClass),isCustomHAM(hamClass));
  }
 else {
    Tr.error(tc,"String_Node_Str");
  }
}
Program: 34898
Project: 34898
Buggy source:
private BasicHttpAuthenticationMechanismTest setModulePropertiesProvider(final String realmName){
  final Properties props=new Properties();
  props.put(JavaEESecConstants.REALM_NAME,realmName);
  mockery.checking(new Expectations(){
{
      one(mpp).getAuthMechProperties(BasicHttpAuthenticationMechanism.class);
      will(returnValue(props));
    }
  }
);
  return this;
}

Fixed version (ground truth):
private BasicHttpAuthenticationMechanismTest setModulePropertiesProvider(final String realmName){
  final Properties props=new Properties();
  props.put(JavaEESecConstants.REALM_NAME,realmName);
  final Instance<ModulePropertiesProvider> mppi=mockery.mock(Instance.class,"String_Node_Str");
  mockery.checking(new Expectations(){
{
      one(cdi).select(ModulePropertiesProvider.class);
      will(returnValue(mppi));
      one(mppi).get();
      will(returnValue(mpp));
      one(mpp).getAuthMechProperties(BasicHttpAuthenticationMechanism.class);
      will(returnValue(props));
    }
  }
);
  return this;
}
Program: 34899
Project: 34899
Buggy source:
@SuppressWarnings("String_Node_Str") private LoginToContinueInterceptorTest withProps(final Properties props) throws Exception {
  final HashMap map=new HashMap();
  map.put(JaspiConstants.SECURITY_WEB_REQUEST,wr);
  mockery.checking(new Expectations(){
{
      between(1,3).of(mpp).getAuthMechProperties(with(any(Class.class)));
      will(returnValue(props));
      one(hmc).getMessageInfo();
      will(returnValue(mi));
      one(mi).getMap();
      will(returnValue(map));
      one(wr).getSecurityMetadata();
      will(returnValue(smd));
      one(smd).setLoginConfiguration(with(any(LoginConfiguration.class)));
    }
  }
);
  return this;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private LoginToContinueInterceptorTest withProps(final Properties props) throws Exception {
  final HashMap map=new HashMap();
  map.put(JaspiConstants.SECURITY_WEB_REQUEST,wr);
  mockery.checking(new Expectations(){
{
      one(cdi).select(ModulePropertiesProvider.class);
      will(returnValue(mppi));
      one(mppi).get();
      will(returnValue(mpp));
      between(1,3).of(mpp).getAuthMechProperties(with(any(Class.class)));
      will(returnValue(props));
      one(hmc).getMessageInfo();
      will(returnValue(mi));
      one(mi).getMap();
      will(returnValue(map));
      one(wr).getSecurityMetadata();
      will(returnValue(smd));
      one(smd).setLoginConfiguration(with(any(LoginConfiguration.class)));
    }
  }
);
  return this;
}
Program: 34900
Project: 34900
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);
  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");
  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;
    }
  }
;
}

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);
  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: 34901
Project: 34901
Buggy source:
@SuppressWarnings("String_Node_Str") private LoginToContinueInterceptorTest withInitProps(final Properties props) throws Exception {
  mockery.checking(new Expectations(){
{
      one(mpp).getAuthMechProperties(with(any(Class.class)));
      will(returnValue(props));
    }
  }
);
  return this;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private LoginToContinueInterceptorTest withInitProps(final Properties props) throws Exception {
  mockery.checking(new Expectations(){
{
      one(cdi).select(ModulePropertiesProvider.class);
      will(returnValue(mppi));
      one(mppi).get();
      will(returnValue(mpp));
      one(mpp).getAuthMechProperties(with(any(Class.class)));
      will(returnValue(props));
    }
  }
);
  return this;
}
Program: 34902
Project: 34902
Buggy source:
@Override public String callerNameAttribute(){
  return null;
}

Fixed version (ground truth):
@Override public String callerNameAttribute(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (String)overrides.get("String_Node_Str") : "String_Node_Str";
}
Program: 34903
Project: 34903
Buggy source:
@Override public String groupMemberAttribute(){
  return null;
}

Fixed version (ground truth):
@Override public String groupMemberAttribute(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (String)overrides.get("String_Node_Str") : "String_Node_Str";
}
Program: 34904
Project: 34904
Buggy source:
@Override public String priorityExpression(){
  return null;
}

Fixed version (ground truth):
@Override public String priorityExpression(){
  return (overrides != null && overrides.containsKey(JavaEESecConstants.PRIORITY_EXPRESSION)) ? (String)overrides.get(JavaEESecConstants.PRIORITY_EXPRESSION) : "String_Node_Str";
}
Program: 34905
Project: 34905
Buggy source:
@Override public String callerSearchFilter(){
  return null;
}

Fixed version (ground truth):
@Override public String callerSearchFilter(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (String)overrides.get("String_Node_Str") : "String_Node_Str";
}
Program: 34906
Project: 34906
Buggy source:
@Override public String readTimeoutExpression(){
  return null;
}

Fixed version (ground truth):
@Override public String readTimeoutExpression(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (String)overrides.get("String_Node_Str") : "String_Node_Str";
}
Program: 34907
Project: 34907
Buggy source:
@Override public String bindDn(){
  return null;
}

Fixed version (ground truth):
@Override public String bindDn(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (String)overrides.get("String_Node_Str") : "String_Node_Str";
}
Program: 34908
Project: 34908
Buggy source:
@Override public String groupSearchFilter(){
  return null;
}

Fixed version (ground truth):
@Override public String groupSearchFilter(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (String)overrides.get("String_Node_Str") : "String_Node_Str";
}
Program: 34909
Project: 34909
Buggy source:
@Override public int maxResults(){
  return 0;
}

Fixed version (ground truth):
@Override public int maxResults(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (Integer)overrides.get("String_Node_Str") : 1000;
}
Program: 34910
Project: 34910
Buggy source:
@Override public String callerBaseDn(){
  return null;
}

Fixed version (ground truth):
@Override public String callerBaseDn(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (String)overrides.get("String_Node_Str") : "String_Node_Str";
}
Program: 34911
Project: 34911
Buggy source:
@Override public String groupNameAttribute(){
  return null;
}

Fixed version (ground truth):
@Override public String groupNameAttribute(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (String)overrides.get("String_Node_Str") : "String_Node_Str";
}
Program: 34912
Project: 34912
Buggy source:
@Override public String maxResultsExpression(){
  return null;
}

Fixed version (ground truth):
@Override public String maxResultsExpression(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (String)overrides.get("String_Node_Str") : "String_Node_Str";
}
Program: 34913
Project: 34913
Buggy source:
@Override public Class<? extends Annotation> annotationType(){
  return DatabaseIdentityStoreDefinition.class;
}

Fixed version (ground truth):
@Override public Class<? extends Annotation> annotationType(){
  return null;
}
Program: 34914
Project: 34914
Buggy source:
@Override public String groupSearchScopeExpression(){
  return null;
}

Fixed version (ground truth):
@Override public String groupSearchScopeExpression(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (String)overrides.get("String_Node_Str") : "String_Node_Str";
}
Program: 34915
Project: 34915
Buggy source:
@Override public int priority(){
  return 0;
}

Fixed version (ground truth):
@Override public int priority(){
  return (overrides != null && overrides.containsKey(JavaEESecConstants.PRIORITY)) ? (Integer)overrides.get(JavaEESecConstants.PRIORITY) : 80;
}
Program: 34916
Project: 34916
Buggy source:
@Override public LdapSearchScope groupSearchScope(){
  return null;
}

Fixed version (ground truth):
@Override public LdapSearchScope groupSearchScope(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (LdapSearchScope)overrides.get("String_Node_Str") : LdapSearchScope.SUBTREE;
}
Program: 34917
Project: 34917
Buggy source:
@Override public String useForExpression(){
  return null;
}

Fixed version (ground truth):
@Override public String useForExpression(){
  return (overrides != null && overrides.containsKey(JavaEESecConstants.USE_FOR_EXPRESSION)) ? (String)overrides.get(JavaEESecConstants.USE_FOR_EXPRESSION) : "String_Node_Str";
}
Program: 34918
Project: 34918
Buggy source:
@Override public String callerSearchScopeExpression(){
  return null;
}

Fixed version (ground truth):
@Override public String callerSearchScopeExpression(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (String)overrides.get("String_Node_Str") : "String_Node_Str";
}
Program: 34919
Project: 34919
Buggy source:
@Override public String callerSearchBase(){
  return null;
}

Fixed version (ground truth):
@Override public String callerSearchBase(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (String)overrides.get("String_Node_Str") : "String_Node_Str";
}
Program: 34920
Project: 34920
Buggy source:
@Override public String groupMemberOfAttribute(){
  return null;
}

Fixed version (ground truth):
@Override public String groupMemberOfAttribute(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (String)overrides.get("String_Node_Str") : "String_Node_Str";
}
Program: 34921
Project: 34921
Buggy source:
@Override public ValidationType[] useFor(){
  return null;
}

Fixed version (ground truth):
@Override public ValidationType[] useFor(){
  return (overrides != null && overrides.containsKey(JavaEESecConstants.USE_FOR)) ? (ValidationType[])overrides.get(JavaEESecConstants.USE_FOR) : new ValidationType[]{ValidationType.PROVIDE_GROUPS,ValidationType.VALIDATE};
}
Program: 34922
Project: 34922
Buggy source:
@Override public String url(){
  return null;
}

Fixed version (ground truth):
@Override public String url(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (String)overrides.get("String_Node_Str") : "String_Node_Str";
}
Program: 34923
Project: 34923
Buggy source:
@Override public String groupSearchBase(){
  return null;
}

Fixed version (ground truth):
@Override public String groupSearchBase(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (String)overrides.get("String_Node_Str") : "String_Node_Str";
}
Program: 34924
Project: 34924
Buggy source:
@Override public int readTimeout(){
  return 0;
}

Fixed version (ground truth):
@Override public int readTimeout(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (Integer)overrides.get("String_Node_Str") : 0;
}
Program: 34925
Project: 34925
Buggy source:
@Override public LdapSearchScope callerSearchScope(){
  return null;
}

Fixed version (ground truth):
@Override public LdapSearchScope callerSearchScope(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (LdapSearchScope)overrides.get("String_Node_Str") : LdapSearchScope.SUBTREE;
}
Program: 34926
Project: 34926
Buggy source:
@Override public String bindDnPassword(){
  return null;
}

Fixed version (ground truth):
@Override public String bindDnPassword(){
  return (overrides != null && overrides.containsKey("String_Node_Str")) ? (String)overrides.get("String_Node_Str") : "String_Node_Str";
}
Program: 34927
Project: 34927
Buggy source:
@Override public AuthStatus validateRequest(MessageInfo messageInfo,Subject clientSubject,Subject serviceSubject) throws AuthException {
  AuthStatus status=AuthStatus.SEND_FAILURE;
  try {
    HttpAuthenticationMechanism authMech=mpu.getHttpAuthenticationMechanism(getCDI());
    HttpMessageContext httpMessageContext=createHttpMessageContext(messageInfo,clientSubject);
    AuthenticationStatus authenticationStatus=authMech.validateRequest((HttpServletRequest)messageInfo.getRequestMessage(),(HttpServletResponse)messageInfo.getResponseMessage(),httpMessageContext);
    status=translateValidateRequestStatus(authenticationStatus);
    registerSession(httpMessageContext);
  }
 catch (  AuthException ae) {
    throw ae;
  }
catch (  Exception e) {
    e.printStackTrace();
    AuthException authException=new AuthException();
    authException.initCause(e);
    throw authException;
  }
  return status;
}

Fixed version (ground truth):
@Override public AuthStatus validateRequest(MessageInfo messageInfo,Subject clientSubject,Subject serviceSubject) throws AuthException {
  AuthStatus status=AuthStatus.SEND_FAILURE;
  try {
    HttpAuthenticationMechanism authMech=mpu.getHttpAuthenticationMechanism(getCDI());
    HttpMessageContext httpMessageContext=createHttpMessageContext(messageInfo,clientSubject);
    AuthenticationStatus authenticationStatus=authMech.validateRequest((HttpServletRequest)messageInfo.getRequestMessage(),(HttpServletResponse)messageInfo.getResponseMessage(),httpMessageContext);
    status=translateValidateRequestStatus(authenticationStatus);
    registerSession(httpMessageContext);
  }
 catch (  Exception e) {
    e.printStackTrace();
    AuthException authException=new AuthException();
    authException.initCause(e);
    throw authException;
  }
  return status;
}
Program: 34928
Project: 34928
Buggy source:
@SuppressWarnings("String_Node_Str") public <T>ContextResolver<T> createContextResolver(Type contextType,Message m,MediaType type){
  Class<?> contextCls=InjectionUtils.getActualType(contextType);
  if (contextCls == null) {
    return null;
  }
  List<ContextResolver<T>> candidates=new LinkedList<ContextResolver<T>>();
  for (  ProviderInfo<ContextResolver<?>> cr : contextResolvers) {
    Type[] types=cr.getProvider().getClass().getGenericInterfaces();
    for (    Type t : types) {
      if (t instanceof ParameterizedType) {
        ParameterizedType pt=(ParameterizedType)t;
        Type[] args=pt.getActualTypeArguments();
        if (args.length > 0) {
          Class<?> argCls=InjectionUtils.getActualType(args[0]);
          if (argCls != null && argCls.isAssignableFrom(contextCls)) {
            List<MediaType> mTypes=JAXRSUtils.getProduceTypes(cr.getProvider().getClass().getAnnotation(Produces.class));
            if (JAXRSUtils.intersectMimeTypes(mTypes,type).size() > 0) {
              injectContextValues(cr,m);
              candidates.add((ContextResolver<T>)cr.getProvider());
            }
          }
        }
      }
    }
  }
  if (candidates.size() == 0) {
    return null;
  }
 else   if (candidates.size() == 1) {
    return candidates.get(0);
  }
 else {
    Collections.sort(candidates,new ClassComparator());
    return new ContextResolverProxy<T>(candidates);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public <T>ContextResolver<T> createContextResolver(Type contextType,Message m,MediaType type){
  Class<?> contextCls=InjectionUtils.getActualType(contextType);
  if (contextCls == null) {
    return null;
  }
  List<ContextResolver<T>> candidates=new LinkedList<ContextResolver<T>>();
  for (  ProviderInfo<ContextResolver<?>> cr : contextResolvers) {
    Type[] types=cr.getProvider().getClass().getGenericInterfaces();
    for (    Type t : types) {
      if (t instanceof ParameterizedType) {
        ParameterizedType pt=(ParameterizedType)t;
        Type[] args=pt.getActualTypeArguments();
        if (args.length > 0) {
          Class<?> argCls=InjectionUtils.getActualType(args[0]);
          if (argCls != null && argCls.isAssignableFrom(contextCls)) {
            List<MediaType> mTypes=JAXRSUtils.getProduceTypes(cr.getProvider().getClass().getAnnotation(Produces.class));
            if (JAXRSUtils.intersectMimeTypes(mTypes,type).size() > 0) {
              injectContextValues(cr,m);
              candidates.add((ContextResolver<T>)cr.getProvider());
            }
          }
        }
      }
    }
  }
  if (candidates.size() == 0) {
    return null;
  }
 else   if (candidates.size() == 1) {
    return candidates.get(0);
  }
 else {
    Collections.sort(candidates,new PriorityBasedClassComparator());
    return new ContextResolverProxy<T>(candidates);
  }
}
Program: 34930
Project: 34930
Buggy source:
/** 
 */
@Test public void testValidateRequestInvalidCredential() throws Exception {
  CallerOnlyCredential coc=new CallerOnlyCredential(USER1);
  withMessageContext(ap,ch).withCredential(coc);
  try {
    AuthenticationStatus status=cfam.validateRequest(req,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):
/** 
 */
@Test public void testValidateRequestInvalidCredential() throws Exception {
  CallerOnlyCredential coc=new CallerOnlyCredential(USER1);
  withMessageContext(ap,ch).withCredential(coc).withBeanInstance(null);
  try {
    AuthenticationStatus status=cfam.validateRequest(req,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: 34931
Project: 34931
Buggy source:
/** 
 */
@Test public void testValidateRequestAuthReqTrueValidIdAndPWNoIdentityStoreHandlerNoCallbackHandler() throws Exception {
  withMessageContext(null).withUsernamePassword(USER1,PASSWORD1).withAuthenticationRequest(true).withBeanInstance(null);
  try {
    AuthenticationStatus status=fam.validateRequest(req,res,hmc);
    fail("String_Node_Str");
  }
 catch (  AuthenticationException e) {
    assertTrue("String_Node_Str",outputMgr.checkForStandardOut("String_Node_Str"));
    assertEquals("String_Node_Str","String_Node_Str",e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 */
@Test public void testValidateRequestAuthReqTrueValidIdAndPWNoIdentityStoreHandlerNoCallbackHandler() throws Exception {
  withMessageContext(null).withUsernamePassword(USER1,PASSWORD1).withAuthenticationRequest(true).withBeanInstance(null).withSetStatusToResponse(HttpServletResponse.SC_FORBIDDEN);
  AuthenticationStatus status=fam.validateRequest(req,res,hmc);
}
Program: 34932
Project: 34932
Buggy source:
@Override public Cookie getSSOCookieFromSSOToken(){
  Cookie ssoCookie;
  try {
    ssoCookie=WebSecurityHelper.getSSOCookieFromSSOToken();
  }
 catch (  Exception e) {
    throw new ProcessingException(e);
  }
  return ssoCookie;
}

Fixed version (ground truth):
@Override public Cookie getSSOCookieFromSSOToken(){
  Cookie ssoCookie;
  try {
    ssoCookie=AccessController.doPrivileged(new PrivilegedExceptionAction<Cookie>(){
      @Override public Cookie run() throws Exception {
        return WebSecurityHelper.getSSOCookieFromSSOToken();
      }
    }
);
  }
 catch (  Exception e) {
    throw new ProcessingException(e);
  }
  return ssoCookie;
}
Program: 34933
Project: 34933
Buggy source:
@Test public void isApplicationIdentityStoreHanderTrue(){
  final Set<Type> types=new HashSet<Type>();
  types.add(new TypeLiteral<Bean>(){
  }
.getType());
  types.add(new TypeLiteral<IdentityStoreHandler>(){
  }
.getType());
  context.checking(new Expectations(){
{
      one(pb).getBean();
      will(returnValue(bn));
      exactly(2).of(bn).getBeanClass();
      will(returnValue(Object.class));
      one(bn).getTypes();
      will(returnValue(types));
    }
  }
);
  JavaEESecCDIExtension j3ce=new JavaEESecCDIExtension();
  assertTrue("String_Node_Str",j3ce.isIdentityStoreHandler(pb));
}

Fixed version (ground truth):
@Test public void isApplicationIdentityStoreHanderTrue(){
  final Set<Type> types=new HashSet<Type>();
  types.add(new TypeLiteral<Bean>(){
  }
.getType());
  types.add(new TypeLiteral<IdentityStoreHandler>(){
  }
.getType());
  context.checking(new Expectations(){
{
      one(pb).getBean();
      will(returnValue(bn));
      between(1,2).of(bn).getBeanClass();
      will(returnValue(Object.class));
      one(bn).getTypes();
      will(returnValue(types));
    }
  }
);
  JavaEESecCDIExtension j3ce=new JavaEESecCDIExtension();
  assertTrue("String_Node_Str",j3ce.isIdentityStoreHandler(pb));
}
Program: 34934
Project: 34934
Buggy source:
@Test public void afterBeanDiscoveryCustomIdentityStoreHandlerExists(){
  final Set<Type> types=new HashSet<Type>();
  types.add(new TypeLiteral<Bean>(){
  }
.getType());
  types.add(new TypeLiteral<IdentityStoreHandler>(){
  }
.getType());
  context.checking(new Expectations(){
{
      exactly(2).of(pb).getBean();
      will(returnValue(bn));
      exactly(3).of(bn).getBeanClass();
      will(returnValue(Object.class));
      exactly(2).of(bn).getTypes();
      will(returnValue(types));
      never(abd).addBean(with(any(IdentityStoreHandlerBean.class)));
    }
  }
);
  JavaEESecCDIExtension j3ce=new JavaEESecCDIExtension();
  assertFalse("String_Node_Str",j3ce.getIdentityStoreHandlerRegistered());
  j3ce.processBean(pb,bm);
  assertTrue("String_Node_Str",j3ce.getIdentityStoreHandlerRegistered());
  j3ce.afterBeanDiscovery(abd,bm);
  assertTrue("String_Node_Str",j3ce.getBeansToAdd().isEmpty());
}

Fixed version (ground truth):
@Test public void afterBeanDiscoveryCustomIdentityStoreHandlerExists(){
  final Set<Type> types=new HashSet<Type>();
  types.add(new TypeLiteral<Bean>(){
  }
.getType());
  types.add(new TypeLiteral<IdentityStoreHandler>(){
  }
.getType());
  context.checking(new Expectations(){
{
      exactly(2).of(pb).getBean();
      will(returnValue(bn));
      between(2,3).of(bn).getBeanClass();
      will(returnValue(Object.class));
      exactly(2).of(bn).getTypes();
      will(returnValue(types));
      never(abd).addBean(with(any(IdentityStoreHandlerBean.class)));
    }
  }
);
  JavaEESecCDIExtension j3ce=new JavaEESecCDIExtension();
  assertFalse("String_Node_Str",j3ce.getIdentityStoreHandlerRegistered());
  j3ce.processBean(pb,bm);
  assertTrue("String_Node_Str",j3ce.getIdentityStoreHandlerRegistered());
  j3ce.afterBeanDiscovery(abd,bm);
  assertTrue("String_Node_Str",j3ce.getBeansToAdd().isEmpty());
}
Program: 34936
Project: 34936
Buggy source:
@Test public void processBeanIdentityStoreHandlerTrueIdentityStoreTrue(){
  final Set<Type> types=new HashSet<Type>();
  types.add(new TypeLiteral<Bean>(){
  }
.getType());
  types.add(new TypeLiteral<IdentityStoreHandler>(){
  }
.getType());
  final Set<Type> types2=new HashSet<Type>();
  types2.add(new TypeLiteral<Bean>(){
  }
.getType());
  types2.add(new TypeLiteral<IdentityStore>(){
  }
.getType());
  context.checking(new Expectations(){
{
      exactly(2).of(pb).getBean();
      will(returnValue(bn));
      exactly(3).of(bn).getBeanClass();
      will(returnValue(Object.class));
      exactly(2).of(bn).getTypes();
      will(returnValue(types));
      one(pb2).getBean();
      will(returnValue(bn2));
      exactly(2).of(bn2).getBeanClass();
      will(returnValue(Object.class));
      one(bn2).getTypes();
      will(returnValue(types2));
    }
  }
);
  JavaEESecCDIExtension j3ce=new JavaEESecCDIExtension();
  assertFalse("String_Node_Str",j3ce.getIdentityStoreHandlerRegistered());
  assertFalse("String_Node_Str",j3ce.getIdentityStoreRegistered());
  j3ce.processBean(pb,bm);
  j3ce.processBean(pb2,bm);
  assertTrue("String_Node_Str",j3ce.getIdentityStoreHandlerRegistered());
  assertTrue("String_Node_Str",j3ce.getIdentityStoreRegistered());
}

Fixed version (ground truth):
@Test public void processBeanIdentityStoreHandlerTrueIdentityStoreTrue(){
  final Set<Type> types=new HashSet<Type>();
  types.add(new TypeLiteral<Bean>(){
  }
.getType());
  types.add(new TypeLiteral<IdentityStoreHandler>(){
  }
.getType());
  final Set<Type> types2=new HashSet<Type>();
  types2.add(new TypeLiteral<Bean>(){
  }
.getType());
  types2.add(new TypeLiteral<IdentityStore>(){
  }
.getType());
  context.checking(new Expectations(){
{
      exactly(2).of(pb).getBean();
      will(returnValue(bn));
      between(2,3).of(bn).getBeanClass();
      will(returnValue(Object.class));
      exactly(2).of(bn).getTypes();
      will(returnValue(types));
      one(pb2).getBean();
      will(returnValue(bn2));
      exactly(2).of(bn2).getBeanClass();
      will(returnValue(Object.class));
      one(bn2).getTypes();
      will(returnValue(types2));
    }
  }
);
  JavaEESecCDIExtension j3ce=new JavaEESecCDIExtension();
  assertFalse("String_Node_Str",j3ce.getIdentityStoreHandlerRegistered());
  assertFalse("String_Node_Str",j3ce.getIdentityStoreRegistered());
  j3ce.processBean(pb,bm);
  j3ce.processBean(pb2,bm);
  assertTrue("String_Node_Str",j3ce.getIdentityStoreHandlerRegistered());
  assertTrue("String_Node_Str",j3ce.getIdentityStoreRegistered());
}
Program: 34937
Project: 34937
Buggy source:
@Test public void isApplicationIdentityStoreTrue(){
  final Set<Type> types=new HashSet<Type>();
  types.add(new TypeLiteral<Bean>(){
  }
.getType());
  types.add(new TypeLiteral<IdentityStore>(){
  }
.getType());
  context.checking(new Expectations(){
{
      one(pb).getBean();
      will(returnValue(bn));
      exactly(2).of(bn).getBeanClass();
      will(returnValue(Object.class));
      one(bn).getTypes();
      will(returnValue(types));
    }
  }
);
  JavaEESecCDIExtension j3ce=new JavaEESecCDIExtension();
  assertTrue("String_Node_Str",j3ce.isIdentityStore(pb));
}

Fixed version (ground truth):
@Test public void isApplicationIdentityStoreTrue(){
  final Set<Type> types=new HashSet<Type>();
  types.add(new TypeLiteral<Bean>(){
  }
.getType());
  types.add(new TypeLiteral<IdentityStore>(){
  }
.getType());
  context.checking(new Expectations(){
{
      one(pb).getBean();
      will(returnValue(bn));
      between(1,2).of(bn).getBeanClass();
      will(returnValue(Object.class));
      one(bn).getTypes();
      will(returnValue(types));
    }
  }
);
  JavaEESecCDIExtension j3ce=new JavaEESecCDIExtension();
  assertTrue("String_Node_Str",j3ce.isIdentityStore(pb));
}
Program: 34938
Project: 34938
Buggy source:
@Test public void afterBeanDiscoveryNoCustomIdentityStoreHandlerOneIdentityStore(){
  final Set<Type> types=new HashSet<Type>();
  types.add(new TypeLiteral<Bean>(){
  }
.getType());
  types.add(new TypeLiteral<IdentityStore>(){
  }
.getType());
  context.checking(new Expectations(){
{
      exactly(2).of(pb).getBean();
      will(returnValue(bn));
      exactly(3).of(bn).getBeanClass();
      will(returnValue(TestIdentityStore.class));
      exactly(2).of(bn).getTypes();
      will(returnValue(types));
      one(abd).addBean(with(any(IdentityStoreHandlerBean.class)));
    }
  }
);
  JavaEESecCDIExtension j3ce=new JavaEESecCDIExtension();
  j3ce.processBean(pb,bm);
  j3ce.afterBeanDiscovery(abd,bm);
  assertTrue("String_Node_Str",j3ce.getIdentityStoreRegistered());
  assertFalse("String_Node_Str",j3ce.getIdentityStoreHandlerRegistered());
  assertFalse("String_Node_Str",j3ce.getBeansToAdd().isEmpty());
}

Fixed version (ground truth):
@Test public void afterBeanDiscoveryNoCustomIdentityStoreHandlerOneIdentityStore(){
  final Set<Type> types=new HashSet<Type>();
  types.add(new TypeLiteral<Bean>(){
  }
.getType());
  types.add(new TypeLiteral<IdentityStore>(){
  }
.getType());
  context.checking(new Expectations(){
{
      exactly(2).of(pb).getBean();
      will(returnValue(bn));
      between(2,3).of(bn).getBeanClass();
      will(returnValue(TestIdentityStore.class));
      exactly(2).of(bn).getTypes();
      will(returnValue(types));
      one(abd).addBean(with(any(IdentityStoreHandlerBean.class)));
    }
  }
);
  JavaEESecCDIExtension j3ce=new JavaEESecCDIExtension();
  j3ce.processBean(pb,bm);
  j3ce.afterBeanDiscovery(abd,bm);
  assertTrue("String_Node_Str",j3ce.getIdentityStoreRegistered());
  assertFalse("String_Node_Str",j3ce.getIdentityStoreHandlerRegistered());
  assertFalse("String_Node_Str",j3ce.getBeansToAdd().isEmpty());
}
Program: 34939
Project: 34939
Buggy source:
@Test public void testMoreThanOneAuthMechDoesNotRegisterProvider() throws Exception {
  Bean<HttpAuthenticationMechanism> httpAuthenticationMechanismBean1=mockery.mock(Bean.class,"String_Node_Str");
  Bean<HttpAuthenticationMechanism> httpAuthenticationMechanismBean2=mockery.mock(Bean.class,"String_Node_Str");
  httpAuthMechs.add(httpAuthenticationMechanismBean1);
  httpAuthMechs.add(httpAuthenticationMechanismBean2);
  withNoCachedProvider().withBeanManager().doesNotRegisterProvider();
  bridgeBuilder.buildBridgeIfNeeded(APP_CONTEXT,providerFactory);
}

Fixed version (ground truth):
@Test public void testMoreThanOneAuthMechDoesNotRegisterProvider() throws Exception {
  final Bean<HttpAuthenticationMechanism> httpAuthenticationMechanismBean1=mockery.mock(Bean.class,"String_Node_Str");
  final Bean<HttpAuthenticationMechanism> httpAuthenticationMechanismBean2=mockery.mock(Bean.class,"String_Node_Str");
  httpAuthMechs.add(httpAuthenticationMechanismBean1);
  httpAuthMechs.add(httpAuthenticationMechanismBean2);
  withNoCachedProvider().withBeanManager().doesNotRegisterProvider();
  mockery.checking(new Expectations(){
{
      allowing(httpAuthenticationMechanismBean1).getBeanClass();
      will(returnValue("String_Node_Str"));
      allowing(httpAuthenticationMechanismBean2).getBeanClass();
      will(returnValue("String_Node_Str"));
    }
  }
);
  bridgeBuilder.buildBridgeIfNeeded(APP_CONTEXT,providerFactory);
}
Program: 34940
Project: 34940
Buggy source:
@Override public boolean handleAttribute(DDParser parser,String nsURI,String localName,int index) throws ParseException {
  if (nsURI == null) {
    if (parser.version >= 24 && "String_Node_Str".equals(localName)) {
      version=parser.parseTokenAttributeValue(index);
      return true;
    }
    if (parser.version >= 24 && "String_Node_Str".equals(localName)) {
      metadata_complete=parser.parseBooleanAttributeValue(index);
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean handleAttribute(DDParser parser,String nsURI,String localName,int index) throws ParseException {
  if (nsURI == null || XMLConstants.NULL_NS_URI.equals(nsURI)) {
    if (parser.version >= 24 && "String_Node_Str".equals(localName)) {
      version=parser.parseTokenAttributeValue(index);
      return true;
    }
    if (parser.version >= 24 && "String_Node_Str".equals(localName)) {
      metadata_complete=parser.parseBooleanAttributeValue(index);
      return true;
    }
  }
  return false;
}
Program: 34943
Project: 34943
Buggy source:
private ManagedObjectFactory<?> getManagedObjectFactory(Class<?> clazz){
  ManagedObjectFactory<?> mof=null;
  try {
    ManagedObjectService mos=managedObjectServiceRef.getServiceWithException();
    if (mos == null) {
      return null;
    }
    ModuleMetaData mmd=ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData().getModuleMetaData();
    mof=mos.createManagedObjectFactory(mmd,clazz,true);
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + clazz.getName());
    }
  }
 catch (  ManagedObjectException e) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + clazz.getName() + "String_Node_Str"+ e.toString());
    }
  }
  return mof;
}

Fixed version (ground truth):
private ManagedObjectFactory<?> getManagedObjectFactory(Class<?> clazz){
  ManagedObjectFactory<?> mof=null;
  try {
    ModuleMetaData mmd=ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData().getModuleMetaData();
    Map<Class<?>,ManagedObjectFactory<?>> cache=managedObjectFactoryCache.get(mmd);
    if (cache != null) {
      mof=cache.get(clazz);
    }
 else {
      cache=new ConcurrentHashMap<Class<?>,ManagedObjectFactory<?>>();
      managedObjectFactoryCache.put(mmd,cache);
    }
    if (mof != null) {
      return mof;
    }
    ManagedObjectService mos=managedObjectServiceRef.getServiceWithException();
    if (mos == null) {
      return null;
    }
    mof=mos.createManagedObjectFactory(mmd,clazz,true);
    cache.put(clazz,mof);
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + clazz.getName());
    }
  }
 catch (  ManagedObjectException e) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + clazz.getName() + "String_Node_Str"+ e.toString());
    }
  }
  return mof;
}
Program: 34944
Project: 34944
Buggy source:
/** 
 * @param clazz
 * @return
 */
@FFDCIgnore(value={Exception.class}) private ManagedObject<?> getClassFromManagedObject(Class<?> clazz){
  ManagedObjectFactory<?> managedObjectFactory=getManagedObjectFactory(clazz);
  ManagedObject<?> bean=null;
  try {
    bean=managedObjectFactory.createManagedObject();
  }
 catch (  Exception e) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + clazz.getName() + "String_Node_Str"+ e.toString());
    }
  }
  if (bean == null) {
    return null;
  }
  return bean;
}

Fixed version (ground truth):
/** 
 * @param clazz
 * @return
 */
@FFDCIgnore(value={Exception.class}) private ManagedObject<?> getClassFromManagedObject(Class<?> clazz){
  ManagedObjectFactory<?> managedObjectFactory=getManagedObjectFactory(clazz);
  ManagedObject<?> bean=null;
  try {
    bean=managedObjectFactory.createManagedObject();
  }
 catch (  Exception e) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + clazz.getName() + "String_Node_Str",e);
    }
  }
  return bean;
}
Program: 34945
Project: 34945
Buggy source:
@Override public void afterServiceInvoke(Object serviceObject,boolean isSingleton,Object context){
  @SuppressWarnings("String_Node_Str") Map<Class<?>,ManagedObject<?>> newContext=(Map<Class<?>,ManagedObject<?>>)(context);
  ManagedObject<?> mo=newContext.get(serviceObject.getClass());
  if (!isSingleton) {
    if (mo != null) {
      mo.release();
    }
    newContext.put(serviceObject.getClass(),null);
  }
}

Fixed version (ground truth):
@Override public void afterServiceInvoke(Object serviceObject,boolean isSingleton,Object context){
  @SuppressWarnings("String_Node_Str") Map<Class<?>,ManagedObject<?>> newContext=(Map<Class<?>,ManagedObject<?>>)(context);
  ManagedObject<?> mo=newContext.get(serviceObject.getClass());
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + mo + "String_Node_Str"+ isSingleton+ "String_Node_Str",newContext);
  }
  if (!isSingleton) {
    if (mo != null) {
      mo.release();
    }
    newContext.put(serviceObject.getClass(),null);
  }
}
Program: 34946
Project: 34946
Buggy source:
@SuppressWarnings("String_Node_Str") private <T>T getInstanceFromManagedObject(T serviceObject,Object context){
  Class<?> clazz=serviceObject.getClass();
  Object rtn=getClassFromCDI(clazz);
  if (rtn != null) {
    return (T)rtn;
  }
  Map<Class<?>,ManagedObject<?>> newContext=(Map<Class<?>,ManagedObject<?>>)(context);
  ManagedObject<?> newServiceObject=null;
  newServiceObject=getClassFromManagedObject(clazz);
  if (newServiceObject != null) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + clazz.getName());
    }
    newContext.put(clazz,newServiceObject);
    return (T)newServiceObject.getObject();
  }
 else {
    newContext.remove(clazz);
  }
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + clazz.getName());
  }
  return serviceObject;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private <T>T getInstanceFromManagedObject(T serviceObject,Object context){
  Class<?> clazz=serviceObject.getClass();
  Object rtn=getClassFromCDI(clazz);
  if (rtn != null) {
    return (T)rtn;
  }
  Map<Class<?>,ManagedObject<?>> newContext=(Map<Class<?>,ManagedObject<?>>)(context);
  ManagedObject<?> newServiceObject=null;
  newServiceObject=getClassFromManagedObject(clazz);
  if (newServiceObject != null) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + clazz.getName());
    }
    ManagedObject<?> oldMO=newContext.put(clazz,newServiceObject);
    if (oldMO != null && TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + oldMO + "String_Node_Str"+ newServiceObject+ "String_Node_Str"+ clazz+ "String_Node_Str"+ newContext);
    }
    return (T)newServiceObject.getObject();
  }
 else {
    newContext.remove(clazz);
  }
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    Tr.debug(tc,"String_Node_Str" + clazz.getName());
  }
  return serviceObject;
}
Program: 34948
Project: 34948
Buggy source:
public static boolean isEJBCDI(Class<?> c,Bus bus){
  List<JaxRsFactoryBeanCustomizer> beanCustomizers=(List<JaxRsFactoryBeanCustomizer>)bus.getProperty(JaxRsConstants.ENDPOINT_LIST_BEANCUSTOMIZER);
  Map<String,BeanCustomizerContext> beanCustomizerContexts=(Map<String,BeanCustomizerContext>)bus.getProperty(JaxRsConstants.ENDPOINT_BEANCUSTOMIZER_CONTEXTOBJ);
  if (beanCustomizers == null || beanCustomizers.isEmpty() || beanCustomizerContexts == null) {
    return false;
  }
  for (  JaxRsFactoryBeanCustomizer beanCustomizer : beanCustomizers) {
    if (beanCustomizer.isCustomizableBean(c,beanCustomizerContexts.get(Integer.toString(beanCustomizer.hashCode())))) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean isEJBCDI(Class<?> c,Bus bus){
  List<JaxRsFactoryBeanCustomizer> beanCustomizers=(List<JaxRsFactoryBeanCustomizer>)bus.getProperty(JaxRsConstants.ENDPOINT_LIST_BEANCUSTOMIZER);
  Map<String,BeanCustomizerContext> beanCustomizerContexts=(Map<String,BeanCustomizerContext>)bus.getProperty(JaxRsConstants.ENDPOINT_BEANCUSTOMIZER_CONTEXTOBJ);
  if (beanCustomizers == null || beanCustomizers.isEmpty() || beanCustomizerContexts == null) {
    return false;
  }
  for (  JaxRsFactoryBeanCustomizer beanCustomizer : beanCustomizers) {
    if (beanCustomizer.isCustomizableBean(c,beanCustomizerContexts.get(createCustomizerKey(beanCustomizer)))) {
      return true;
    }
  }
  return false;
}
Program: 34949
Project: 34949
Buggy source:
public static Object getBeanCustomizerContext(JaxRsFactoryBeanCustomizer beanCustomizer,Bus bus){
  Map<String,BeanCustomizerContext> beanCustomizerContexts=(Map<String,BeanCustomizerContext>)bus.getProperty(JaxRsConstants.ENDPOINT_BEANCUSTOMIZER_CONTEXTOBJ);
  return beanCustomizerContexts.get(Integer.toString(beanCustomizer.hashCode()));
}

Fixed version (ground truth):
public static Object getBeanCustomizerContext(JaxRsFactoryBeanCustomizer beanCustomizer,Bus bus){
  Map<String,BeanCustomizerContext> beanCustomizerContexts=(Map<String,BeanCustomizerContext>)bus.getProperty(JaxRsConstants.ENDPOINT_BEANCUSTOMIZER_CONTEXTOBJ);
  return beanCustomizerContexts.get(createCustomizerKey(beanCustomizer));
}