Program: 112167
Project: 112167
Buggy source:
@SuppressWarnings("String_Node_Str") @Override protected void initialize() throws ServletException {
  super.initialize();
  setFhirContext(ContextHolder.getCtx());
  myAppCtx=ContextLoaderListener.getCurrentWebApplicationContext();
  String resourceProviderBeanName;
  FhirVersionEnum fhirVersion=ContextHolder.getCtx().getVersion().getVersion();
switch (fhirVersion) {
case DSTU2:
    resourceProviderBeanName="String_Node_Str";
  break;
case DSTU3:
resourceProviderBeanName="String_Node_Str";
break;
case R4:
resourceProviderBeanName="String_Node_Str";
break;
default :
throw new IllegalStateException();
}
List<IResourceProvider> beans=myAppCtx.getBean(resourceProviderBeanName,List.class);
setResourceProviders(beans);
List<Object> systemProvider=new ArrayList<Object>();
if (fhirVersion == FhirVersionEnum.DSTU2) {
systemProvider.add(myAppCtx.getBean("String_Node_Str",JpaSystemProviderDstu2.class));
}
 else if (fhirVersion == FhirVersionEnum.DSTU3) {
systemProvider.add(myAppCtx.getBean("String_Node_Str",JpaSystemProviderDstu3.class));
systemProvider.add(myAppCtx.getBean(TerminologyUploaderProvider.class));
}
 else if (fhirVersion == FhirVersionEnum.R4) {
systemProvider.add(myAppCtx.getBean("String_Node_Str",JpaSystemProviderR4.class));
systemProvider.add(myAppCtx.getBean(TerminologyUploaderProvider.class));
}
 else {
throw new IllegalStateException();
}
setPlainProviders(systemProvider);
if (fhirVersion == FhirVersionEnum.DSTU2) {
IFhirSystemDao<Bundle,MetaDt> systemDao=myAppCtx.getBean("String_Node_Str",IFhirSystemDao.class);
JpaConformanceProviderDstu2 confProvider=new JpaConformanceProviderDstu2(this,systemDao,myAppCtx.getBean(DaoConfig.class));
confProvider.setImplementationDescription("String_Node_Str");
setServerConformanceProvider(confProvider);
}
 else if (fhirVersion == FhirVersionEnum.DSTU3) {
IFhirSystemDao<org.hl7.fhir.dstu3.model.Bundle,org.hl7.fhir.dstu3.model.Meta> systemDao=myAppCtx.getBean("String_Node_Str",IFhirSystemDao.class);
JpaConformanceProviderDstu3 confProvider=new JpaConformanceProviderDstu3(this,systemDao,myAppCtx.getBean(DaoConfig.class));
confProvider.setImplementationDescription("String_Node_Str");
setServerConformanceProvider(confProvider);
}
 else if (fhirVersion == FhirVersionEnum.R4) {
IFhirSystemDao<org.hl7.fhir.r4.model.Bundle,org.hl7.fhir.r4.model.Meta> systemDao=myAppCtx.getBean("String_Node_Str",IFhirSystemDao.class);
JpaConformanceProviderR4 confProvider=new JpaConformanceProviderR4(this,systemDao,myAppCtx.getBean(DaoConfig.class));
confProvider.setImplementationDescription("String_Node_Str");
setServerConformanceProvider(confProvider);
}
 else {
throw new IllegalStateException();
}
setETagSupport(ETagSupportEnum.ENABLED);
FhirContext ctx=getFhirContext();
ctx.setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator());
setDefaultPrettyPrint(true);
setDefaultResponseEncoding(EncodingEnum.JSON);
setPagingProvider(new FifoMemoryPagingProvider(10));
CorsInterceptor corsInterceptor=new CorsInterceptor();
registerInterceptor(corsInterceptor);
Collection<IServerInterceptor> interceptorBeans=myAppCtx.getBeansOfType(IServerInterceptor.class).values();
for (IServerInterceptor interceptor : interceptorBeans) {
this.registerInterceptor(interceptor);
}
DaoConfig daoConfig=myAppCtx.getBean(DaoConfig.class);
daoConfig.setAllowExternalReferences(ContextHolder.isAllowExternalRefs());
daoConfig.setEnforceReferentialIntegrityOnDelete(!ContextHolder.isDisableReferentialIntegrity());
daoConfig.setEnforceReferentialIntegrityOnWrite(!ContextHolder.isDisableReferentialIntegrity());
daoConfig.setReuseCachedSearchResultsForMillis(ContextHolder.getReuseCachedSearchResultsForMillis());
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override protected void initialize() throws ServletException {
  super.initialize();
  setFhirContext(ContextHolder.getCtx());
  myAppCtx=ContextLoaderListener.getCurrentWebApplicationContext();
  String resourceProviderBeanName;
  FhirVersionEnum fhirVersion=ContextHolder.getCtx().getVersion().getVersion();
switch (fhirVersion) {
case DSTU2:
    resourceProviderBeanName="String_Node_Str";
  break;
case DSTU3:
resourceProviderBeanName="String_Node_Str";
break;
case R4:
resourceProviderBeanName="String_Node_Str";
break;
default :
throw new IllegalStateException();
}
List<IResourceProvider> beans=myAppCtx.getBean(resourceProviderBeanName,List.class);
setResourceProviders(beans);
List<Object> systemProvider=new ArrayList<Object>();
if (fhirVersion == FhirVersionEnum.DSTU2) {
systemProvider.add(myAppCtx.getBean("String_Node_Str",JpaSystemProviderDstu2.class));
}
 else if (fhirVersion == FhirVersionEnum.DSTU3) {
systemProvider.add(myAppCtx.getBean("String_Node_Str",JpaSystemProviderDstu3.class));
systemProvider.add(myAppCtx.getBean(TerminologyUploaderProviderDstu3.class));
}
 else if (fhirVersion == FhirVersionEnum.R4) {
systemProvider.add(myAppCtx.getBean("String_Node_Str",JpaSystemProviderR4.class));
systemProvider.add(myAppCtx.getBean(TerminologyUploaderProviderR4.class));
}
 else {
throw new IllegalStateException();
}
setPlainProviders(systemProvider);
if (fhirVersion == FhirVersionEnum.DSTU2) {
IFhirSystemDao<Bundle,MetaDt> systemDao=myAppCtx.getBean("String_Node_Str",IFhirSystemDao.class);
JpaConformanceProviderDstu2 confProvider=new JpaConformanceProviderDstu2(this,systemDao,myAppCtx.getBean(DaoConfig.class));
confProvider.setImplementationDescription("String_Node_Str");
setServerConformanceProvider(confProvider);
}
 else if (fhirVersion == FhirVersionEnum.DSTU3) {
IFhirSystemDao<org.hl7.fhir.dstu3.model.Bundle,org.hl7.fhir.dstu3.model.Meta> systemDao=myAppCtx.getBean("String_Node_Str",IFhirSystemDao.class);
JpaConformanceProviderDstu3 confProvider=new JpaConformanceProviderDstu3(this,systemDao,myAppCtx.getBean(DaoConfig.class));
confProvider.setImplementationDescription("String_Node_Str");
setServerConformanceProvider(confProvider);
}
 else if (fhirVersion == FhirVersionEnum.R4) {
IFhirSystemDao<org.hl7.fhir.r4.model.Bundle,org.hl7.fhir.r4.model.Meta> systemDao=myAppCtx.getBean("String_Node_Str",IFhirSystemDao.class);
JpaConformanceProviderR4 confProvider=new JpaConformanceProviderR4(this,systemDao,myAppCtx.getBean(DaoConfig.class));
confProvider.setImplementationDescription("String_Node_Str");
setServerConformanceProvider(confProvider);
}
 else {
throw new IllegalStateException();
}
setETagSupport(ETagSupportEnum.ENABLED);
FhirContext ctx=getFhirContext();
ctx.setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator());
setDefaultPrettyPrint(true);
setDefaultResponseEncoding(EncodingEnum.JSON);
setPagingProvider(new FifoMemoryPagingProvider(10));
CorsInterceptor corsInterceptor=new CorsInterceptor();
registerInterceptor(corsInterceptor);
Collection<IServerInterceptor> interceptorBeans=myAppCtx.getBeansOfType(IServerInterceptor.class).values();
for (IServerInterceptor interceptor : interceptorBeans) {
this.registerInterceptor(interceptor);
}
DaoConfig daoConfig=myAppCtx.getBean(DaoConfig.class);
daoConfig.setAllowExternalReferences(ContextHolder.isAllowExternalRefs());
daoConfig.setEnforceReferentialIntegrityOnDelete(!ContextHolder.isDisableReferentialIntegrity());
daoConfig.setEnforceReferentialIntegrityOnWrite(!ContextHolder.isDisableReferentialIntegrity());
daoConfig.setReuseCachedSearchResultsForMillis(ContextHolder.getReuseCachedSearchResultsForMillis());
}