Program: 34953
Project: 34953
Buggy source:
protected synchronized void doInit() throws ServletException {
  Bus serverBus=this.moduleMetadata.getServerMetaData().getServerBus();
  this.setBus(serverBus);
  this.setAddress(endpointInfo.getAddress());
  this.setStart(false);
  this.getBus().setProperty(JaxRsConstants.ENDPOINT_LIST_BEANCUSTOMIZER,beanCustomizers);
  this.getBus().setProperty(JaxRsConstants.ENDPOINT_BEANCUSTOMIZER_CONTEXTOBJ,beanCustomizerContexts);
  this.getBus().setProperty(JaxRsConstants.PROVIDER_CACHE_ALLOWED,true);
  this.getBus().setProperty(JaxRsConstants.PROVIDER_CACHE_CHECK_ALL,true);
  this.getBus().getOutInterceptors().add(new LibertyClearInjectRuntimeCtxOutInterceptor<Message>(Phase.MARSHAL));
  CXFJaxRsProviderResourceHolder cxfPRHolder=new CXFJaxRsProviderResourceHolder();
  try {
    this.onApplicationInit(cxfPRHolder);
  }
 catch (  ClassNotFoundException e) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + e.getMessage());
    }
    throw new ServletException(e.getMessage(),e);
  }
catch (  ServletException e) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + e.getMessage());
    }
    throw e;
  }
  if (endpointInfo.getPerRequestProviderAndPathInfos().isEmpty() && endpointInfo.getSingletonProviderAndPathInfos().isEmpty() && endpointInfo.getAbstractClassInterfaceList().isEmpty()) {
    throw new ServletException("String_Node_Str" + endpointInfo.getAppClassName());
  }
  for (  JaxRsFactoryBeanCustomizer customizer : beanCustomizers) {
    BeanCustomizerContext context=new BeanCustomizerContext(endpointInfo,moduleMetadata,cxfPRHolder);
    customizer.onPrepareProviderResource(context);
    Object customizerContext=context.getContextObject();
    if (customizerContext != null) {
      beanCustomizerContexts.put(Integer.toString(customizer.hashCode()),customizerContext);
    }
  }
  boolean isEnableBeanValidation=JaxRsBeanValidation.enableBeanValidationProviders(cxfPRHolder.getProviders());
  this.setInvoker(new LibertyJaxRsInvoker(this,isEnableBeanValidation));
  boolean clientSide=false;
  providerFactoryService.bindProviders(clientSide,cxfPRHolder.getProviders());
  List<Class<?>> resourceClasses=cxfPRHolder.getResourceClasses();
synchronized (resourceClasses) {
    this.setResourceClasses(resourceClasses);
  }
  List<Object> providersList=cxfPRHolder.getProviders();
synchronized (providersList) {
    this.setProviders(providersList);
  }
  Map<Class<?>,ResourceProvider> resourceProviderMap=cxfPRHolder.getResouceProviderMap();
synchronized (resourceProviderMap) {
    for (    Map.Entry<Class<?>,ResourceProvider> entry : resourceProviderMap.entrySet()) {
      this.setResourceProvider(entry.getKey(),entry.getValue());
    }
  }
  Map<Class<?>,Class<?>> absMap=cxfPRHolder.getAbstractResourceMap();
synchronized (absMap) {
    for (    ClassResourceInfo cri : this.serviceFactory.getClassResourceInfo()) {
      if (absMap.containsKey(cri.getServiceClass())) {
        cri.setResourceClass(absMap.get(cri.getServiceClass()));
      }
    }
  }
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    boolean serviceWasNull=false;
    Service service=this.serviceFactory.getService();
    if (service == null) {
      service=serviceFactory.create();
      serviceWasNull=true;
    }
    List<ClassResourceInfo> resources=((JAXRSServiceImpl)service).getClassResourceInfos();
    StringBuilder stringBuilder=new StringBuilder();
    for (    ClassResourceInfo classResourceInfo : resources) {
      stringBuilder.append(classResourceInfo.getResourceClass());
      stringBuilder.append("String_Node_Str");
    }
    String stringClassResourceInfo=stringBuilder.toString();
    if (serviceWasNull) {
      this.serviceFactory.setService(null);
    }
    Tr.debug(tc,"String_Node_Str" + stringClassResourceInfo);
  }
}

Fixed version (ground truth):
protected synchronized void doInit() throws ServletException {
  Bus serverBus=this.moduleMetadata.getServerMetaData().getServerBus();
  this.setBus(serverBus);
  this.setAddress(endpointInfo.getAddress());
  this.setStart(false);
  this.getBus().setProperty(JaxRsConstants.ENDPOINT_LIST_BEANCUSTOMIZER,beanCustomizers);
  this.getBus().setProperty(JaxRsConstants.ENDPOINT_BEANCUSTOMIZER_CONTEXTOBJ,beanCustomizerContexts);
  this.getBus().setProperty(JaxRsConstants.PROVIDER_CACHE_ALLOWED,true);
  this.getBus().setProperty(JaxRsConstants.PROVIDER_CACHE_CHECK_ALL,true);
  this.getBus().getOutInterceptors().add(new LibertyClearInjectRuntimeCtxOutInterceptor<Message>(Phase.MARSHAL));
  CXFJaxRsProviderResourceHolder cxfPRHolder=new CXFJaxRsProviderResourceHolder();
  try {
    this.onApplicationInit(cxfPRHolder);
  }
 catch (  ClassNotFoundException e) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + e.getMessage());
    }
    throw new ServletException(e.getMessage(),e);
  }
catch (  ServletException e) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
      Tr.debug(tc,"String_Node_Str" + e.getMessage());
    }
    throw e;
  }
  if (endpointInfo.getPerRequestProviderAndPathInfos().isEmpty() && endpointInfo.getSingletonProviderAndPathInfos().isEmpty() && endpointInfo.getAbstractClassInterfaceList().isEmpty()) {
    throw new ServletException("String_Node_Str" + endpointInfo.getAppClassName());
  }
  for (  JaxRsFactoryBeanCustomizer customizer : beanCustomizers) {
    BeanCustomizerContext context=new BeanCustomizerContext(endpointInfo,moduleMetadata,cxfPRHolder);
    customizer.onPrepareProviderResource(context);
    Object customizerContext=context.getContextObject();
    if (customizerContext != null) {
      beanCustomizerContexts.put(createCustomizerKey(customizer),customizerContext);
    }
  }
  boolean isEnableBeanValidation=JaxRsBeanValidation.enableBeanValidationProviders(cxfPRHolder.getProviders());
  this.setInvoker(new LibertyJaxRsInvoker(this,isEnableBeanValidation));
  boolean clientSide=false;
  providerFactoryService.bindProviders(clientSide,cxfPRHolder.getProviders());
  List<Class<?>> resourceClasses=cxfPRHolder.getResourceClasses();
synchronized (resourceClasses) {
    this.setResourceClasses(resourceClasses);
  }
  List<Object> providersList=cxfPRHolder.getProviders();
synchronized (providersList) {
    this.setProviders(providersList);
  }
  Map<Class<?>,ResourceProvider> resourceProviderMap=cxfPRHolder.getResouceProviderMap();
synchronized (resourceProviderMap) {
    for (    Map.Entry<Class<?>,ResourceProvider> entry : resourceProviderMap.entrySet()) {
      this.setResourceProvider(entry.getKey(),entry.getValue());
    }
  }
  Map<Class<?>,Class<?>> absMap=cxfPRHolder.getAbstractResourceMap();
synchronized (absMap) {
    for (    ClassResourceInfo cri : this.serviceFactory.getClassResourceInfo()) {
      if (absMap.containsKey(cri.getServiceClass())) {
        cri.setResourceClass(absMap.get(cri.getServiceClass()));
      }
    }
  }
  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
    boolean serviceWasNull=false;
    Service service=this.serviceFactory.getService();
    if (service == null) {
      service=serviceFactory.create();
      serviceWasNull=true;
    }
    List<ClassResourceInfo> resources=((JAXRSServiceImpl)service).getClassResourceInfos();
    StringBuilder stringBuilder=new StringBuilder();
    for (    ClassResourceInfo classResourceInfo : resources) {
      stringBuilder.append(classResourceInfo.getResourceClass());
      stringBuilder.append("String_Node_Str");
    }
    String stringClassResourceInfo=stringBuilder.toString();
    if (serviceWasNull) {
      this.serviceFactory.setService(null);
    }
    Tr.debug(tc,"String_Node_Str" + stringClassResourceInfo);
  }
}