Program: 34947
Project: 34947
Buggy source:
/** 
 * RuntimeContextTLS can init the EJB or CDI provider
 * @param < T >
 * @param < T >
 * @param resource
 * @param message
 */
public static <T>void initSingletonEJBCDIProvider(AbstractResourceInfo resource,Message message,T resourceObject){
  if ((!(resource instanceof ProviderInfo)) || (resource instanceof ApplicationInfo) || resource.getConstructorProxies() != null) {
    return;
  }
  ProviderInfo<T> pi=(ProviderInfo<T>)resource;
  if (pi.isInit()) {
    return;
  }
  Class clz=pi.getProvider().getClass();
  Bus bus=resource.getBus();
  List<JaxRsFactoryBeanCustomizer> beanCustomizers=(List<JaxRsFactoryBeanCustomizer>)bus.getProperty(JaxRsConstants.ENDPOINT_LIST_BEANCUSTOMIZER);
  Map<String,Object> beanCustomizerContexts=(Map<String,Object>)bus.getProperty(JaxRsConstants.ENDPOINT_BEANCUSTOMIZER_CONTEXTOBJ);
  if (beanCustomizers != null && !beanCustomizers.isEmpty() && beanCustomizerContexts != null) {
    Object newProviderInstance=null;
    for (    JaxRsFactoryBeanCustomizer beanCustomizer : beanCustomizers) {
      if (beanCustomizer.isCustomizableBean(clz,beanCustomizerContexts.get(Integer.toString(beanCustomizer.hashCode())))) {
        newProviderInstance=beanCustomizer.onSingletonProviderInit(pi.getProvider(),beanCustomizerContexts.get(Integer.toString(beanCustomizer.hashCode())),message);
        if (newProviderInstance != null) {
          pi.setProvider(newProviderInstance);
          pi.setIsInit(true);
          return;
        }
      }
    }
  }
  pi.setIsInit(true);
  Method postConstructMethod=ResourceUtils.findPostConstructMethod(clz);
  InjectionUtils.invokeLifeCycleMethod(pi.getProvider(),postConstructMethod);
}

Fixed version (ground truth):
/** 
 * RuntimeContextTLS can init the EJB or CDI provider
 * @param < T >
 * @param < T >
 * @param resource
 * @param message
 */
public static <T>void initSingletonEJBCDIProvider(AbstractResourceInfo resource,Message message,T resourceObject){
  if ((!(resource instanceof ProviderInfo)) || (resource instanceof ApplicationInfo) || resource.getConstructorProxies() != null) {
    return;
  }
  ProviderInfo<T> pi=(ProviderInfo<T>)resource;
  if (pi.isInit()) {
    return;
  }
  Class clz=pi.getProvider().getClass();
  Bus bus=resource.getBus();
  List<JaxRsFactoryBeanCustomizer> beanCustomizers=(List<JaxRsFactoryBeanCustomizer>)bus.getProperty(JaxRsConstants.ENDPOINT_LIST_BEANCUSTOMIZER);
  Map<String,Object> beanCustomizerContexts=(Map<String,Object>)bus.getProperty(JaxRsConstants.ENDPOINT_BEANCUSTOMIZER_CONTEXTOBJ);
  if (beanCustomizers != null && !beanCustomizers.isEmpty() && beanCustomizerContexts != null) {
    Object newProviderInstance=null;
    for (    JaxRsFactoryBeanCustomizer beanCustomizer : beanCustomizers) {
      if (beanCustomizer.isCustomizableBean(clz,beanCustomizerContexts.get(createCustomizerKey(beanCustomizer)))) {
        newProviderInstance=beanCustomizer.onSingletonProviderInit(pi.getProvider(),beanCustomizerContexts.get(Integer.toString(beanCustomizer.hashCode())),message);
        if (newProviderInstance != null) {
          pi.setProvider(newProviderInstance);
          pi.setIsInit(true);
          return;
        }
      }
    }
  }
  pi.setIsInit(true);
  Method postConstructMethod=ResourceUtils.findPostConstructMethod(clz);
  InjectionUtils.invokeLifeCycleMethod(pi.getProvider(),postConstructMethod);
}