Program: 112168
Project: 112168
Buggy source:
@SuppressWarnings("String_Node_Str") @Override protected void initialize() throws ServletException {
  super.initialize();
  WebApplicationContext parentAppCtx=ContextLoaderListener.getCurrentWebApplicationContext();
  String implDesc=getInitParameter("String_Node_Str");
  String fhirVersionParam=getInitParameter("String_Node_Str");
  if (StringUtils.isBlank(fhirVersionParam)) {
    fhirVersionParam="String_Node_Str";
  }
  List<IResourceProvider> beans;
  @SuppressWarnings("String_Node_Str") IFhirSystemDao systemDao;
  ETagSupportEnum etagSupport;
  String baseUrlProperty;
  List<Object> plainProviders=new ArrayList<Object>();
switch (fhirVersionParam.trim().toUpperCase()) {
case "String_Node_Str":
case "String_Node_Str":
{
      myAppCtx=new AnnotationConfigWebApplicationContext();
      myAppCtx.setServletConfig(getServletConfig());
      myAppCtx.setParent(parentAppCtx);
      if ("String_Node_Str".equals(fhirVersionParam.trim().toUpperCase())) {
        myAppCtx.register(TdlDstu2Config.class);
        baseUrlProperty=FHIR_BASEURL_TDL2;
      }
 else {
        myAppCtx.register(TestDstu2Config.class,WebsocketDispatcherConfig.class);
        baseUrlProperty=FHIR_BASEURL_DSTU2;
      }
      myAppCtx.refresh();
      setFhirContext(FhirContext.forDstu2());
      beans=myAppCtx.getBean("String_Node_Str",List.class);
      plainProviders.add(myAppCtx.getBean("String_Node_Str",JpaSystemProviderDstu2.class));
      systemDao=myAppCtx.getBean("String_Node_Str",IFhirSystemDao.class);
      etagSupport=ETagSupportEnum.ENABLED;
      JpaConformanceProviderDstu2 confProvider=new JpaConformanceProviderDstu2(this,systemDao,myAppCtx.getBean(DaoConfig.class));
      confProvider.setImplementationDescription(implDesc);
      setServerConformanceProvider(confProvider);
      break;
    }
case "String_Node_Str":
case "String_Node_Str":
{
    myAppCtx=new AnnotationConfigWebApplicationContext();
    myAppCtx.setServletConfig(getServletConfig());
    myAppCtx.setParent(parentAppCtx);
    if ("String_Node_Str".equals(fhirVersionParam.trim().toUpperCase())) {
      myAppCtx.register(TdlDstu3Config.class);
      baseUrlProperty=FHIR_BASEURL_TDL3;
    }
 else {
      myAppCtx.register(TestDstu3Config.class,WebsocketDispatcherConfig.class);
      baseUrlProperty=FHIR_BASEURL_DSTU3;
    }
    myAppCtx.refresh();
    setFhirContext(FhirContext.forDstu3());
    beans=myAppCtx.getBean("String_Node_Str",List.class);
    plainProviders.add(myAppCtx.getBean("String_Node_Str",JpaSystemProviderDstu3.class));
    systemDao=myAppCtx.getBean("String_Node_Str",IFhirSystemDao.class);
    etagSupport=ETagSupportEnum.ENABLED;
    JpaConformanceProviderDstu3 confProvider=new JpaConformanceProviderDstu3(this,systemDao,myAppCtx.getBean(DaoConfig.class));
    confProvider.setImplementationDescription(implDesc);
    setServerConformanceProvider(confProvider);
    plainProviders.add(myAppCtx.getBean(TerminologyUploaderProvider.class));
    break;
  }
case "String_Node_Str":
{
  myAppCtx=new AnnotationConfigWebApplicationContext();
  myAppCtx.setServletConfig(getServletConfig());
  myAppCtx.setParent(parentAppCtx);
  myAppCtx.register(TestR4Config.class,WebsocketDispatcherConfig.class);
  baseUrlProperty=FHIR_BASEURL_R4;
  myAppCtx.refresh();
  setFhirContext(FhirContext.forR4());
  beans=myAppCtx.getBean("String_Node_Str",List.class);
  plainProviders.add(myAppCtx.getBean("String_Node_Str",JpaSystemProviderR4.class));
  systemDao=myAppCtx.getBean("String_Node_Str",IFhirSystemDao.class);
  etagSupport=ETagSupportEnum.ENABLED;
  JpaConformanceProviderR4 confProvider=new JpaConformanceProviderR4(this,systemDao,myAppCtx.getBean(DaoConfig.class));
  confProvider.setImplementationDescription(implDesc);
  setServerConformanceProvider(confProvider);
  plainProviders.add(myAppCtx.getBean(TerminologyUploaderProvider.class));
  break;
}
default :
throw new ServletException("String_Node_Str" + fhirVersionParam);
}
setETagSupport(etagSupport);
FhirContext ctx=getFhirContext();
ctx.setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator());
for (IResourceProvider nextResourceProvider : beans) {
ourLog.info("String_Node_Str",nextResourceProvider.getResourceType().getSimpleName());
}
setResourceProviders(beans);
setPlainProviders(plainProviders);
CorsInterceptor corsInterceptor=new CorsInterceptor();
registerInterceptor(corsInterceptor);
registerInterceptor(new VersionedApiConverterInterceptor());
ResponseHighlighterInterceptor responseHighlighterInterceptor=new ResponseHighlighterInterceptor();
responseHighlighterInterceptor.setShowRequestHeaders(false);
responseHighlighterInterceptor.setShowResponseHeaders(true);
registerInterceptor(responseHighlighterInterceptor);
registerInterceptor(new BanUnsupportedHttpMethodsInterceptor());
setDefaultPrettyPrint(true);
setDefaultResponseEncoding(EncodingEnum.JSON);
String baseUrl=System.getProperty(baseUrlProperty);
if (StringUtils.isBlank(baseUrl)) {
baseUrl=System.getProperty("String_Node_Str");
if (StringUtils.isBlank(baseUrl)) {
throw new ServletException("String_Node_Str" + baseUrlProperty);
}
}
setServerAddressStrategy(new MyHardcodedServerAddressStrategy(baseUrl));
setPagingProvider(myAppCtx.getBean(DatabaseBackedPagingProvider.class));
Collection<IServerInterceptor> interceptorBeans=myAppCtx.getBeansOfType(IServerInterceptor.class).values();
for (IServerInterceptor interceptor : interceptorBeans) {
this.registerInterceptor(interceptor);
}
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override protected void initialize() throws ServletException {
  super.initialize();
  WebApplicationContext parentAppCtx=ContextLoaderListener.getCurrentWebApplicationContext();
  String implDesc=getInitParameter("String_Node_Str");
  String fhirVersionParam=getInitParameter("String_Node_Str");
  if (StringUtils.isBlank(fhirVersionParam)) {
    fhirVersionParam="String_Node_Str";
  }
  List<IResourceProvider> beans;
  @SuppressWarnings("String_Node_Str") IFhirSystemDao systemDao;
  ETagSupportEnum etagSupport;
  String baseUrlProperty;
  List<Object> plainProviders=new ArrayList<Object>();
switch (fhirVersionParam.trim().toUpperCase()) {
case "String_Node_Str":
case "String_Node_Str":
{
      myAppCtx=new AnnotationConfigWebApplicationContext();
      myAppCtx.setServletConfig(getServletConfig());
      myAppCtx.setParent(parentAppCtx);
      if ("String_Node_Str".equals(fhirVersionParam.trim().toUpperCase())) {
        myAppCtx.register(TdlDstu2Config.class);
        baseUrlProperty=FHIR_BASEURL_TDL2;
      }
 else {
        myAppCtx.register(TestDstu2Config.class,WebsocketDispatcherConfig.class);
        baseUrlProperty=FHIR_BASEURL_DSTU2;
      }
      myAppCtx.refresh();
      setFhirContext(FhirContext.forDstu2());
      beans=myAppCtx.getBean("String_Node_Str",List.class);
      plainProviders.add(myAppCtx.getBean("String_Node_Str",JpaSystemProviderDstu2.class));
      systemDao=myAppCtx.getBean("String_Node_Str",IFhirSystemDao.class);
      etagSupport=ETagSupportEnum.ENABLED;
      JpaConformanceProviderDstu2 confProvider=new JpaConformanceProviderDstu2(this,systemDao,myAppCtx.getBean(DaoConfig.class));
      confProvider.setImplementationDescription(implDesc);
      setServerConformanceProvider(confProvider);
      break;
    }
case "String_Node_Str":
case "String_Node_Str":
{
    myAppCtx=new AnnotationConfigWebApplicationContext();
    myAppCtx.setServletConfig(getServletConfig());
    myAppCtx.setParent(parentAppCtx);
    if ("String_Node_Str".equals(fhirVersionParam.trim().toUpperCase())) {
      myAppCtx.register(TdlDstu3Config.class);
      baseUrlProperty=FHIR_BASEURL_TDL3;
    }
 else {
      myAppCtx.register(TestDstu3Config.class,WebsocketDispatcherConfig.class);
      baseUrlProperty=FHIR_BASEURL_DSTU3;
    }
    myAppCtx.refresh();
    setFhirContext(FhirContext.forDstu3());
    beans=myAppCtx.getBean("String_Node_Str",List.class);
    plainProviders.add(myAppCtx.getBean("String_Node_Str",JpaSystemProviderDstu3.class));
    systemDao=myAppCtx.getBean("String_Node_Str",IFhirSystemDao.class);
    etagSupport=ETagSupportEnum.ENABLED;
    JpaConformanceProviderDstu3 confProvider=new JpaConformanceProviderDstu3(this,systemDao,myAppCtx.getBean(DaoConfig.class));
    confProvider.setImplementationDescription(implDesc);
    setServerConformanceProvider(confProvider);
    plainProviders.add(myAppCtx.getBean(TerminologyUploaderProviderDstu3.class));
    break;
  }
case "String_Node_Str":
{
  myAppCtx=new AnnotationConfigWebApplicationContext();
  myAppCtx.setServletConfig(getServletConfig());
  myAppCtx.setParent(parentAppCtx);
  myAppCtx.register(TestR4Config.class,WebsocketDispatcherConfig.class);
  baseUrlProperty=FHIR_BASEURL_R4;
  myAppCtx.refresh();
  setFhirContext(FhirContext.forR4());
  beans=myAppCtx.getBean("String_Node_Str",List.class);
  plainProviders.add(myAppCtx.getBean("String_Node_Str",JpaSystemProviderR4.class));
  systemDao=myAppCtx.getBean("String_Node_Str",IFhirSystemDao.class);
  etagSupport=ETagSupportEnum.ENABLED;
  JpaConformanceProviderR4 confProvider=new JpaConformanceProviderR4(this,systemDao,myAppCtx.getBean(DaoConfig.class));
  confProvider.setImplementationDescription(implDesc);
  setServerConformanceProvider(confProvider);
  plainProviders.add(myAppCtx.getBean(TerminologyUploaderProviderR4.class));
  break;
}
default :
throw new ServletException("String_Node_Str" + fhirVersionParam);
}
setETagSupport(etagSupport);
FhirContext ctx=getFhirContext();
ctx.setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator());
for (IResourceProvider nextResourceProvider : beans) {
ourLog.info("String_Node_Str",nextResourceProvider.getResourceType().getSimpleName());
}
setResourceProviders(beans);
setPlainProviders(plainProviders);
CorsInterceptor corsInterceptor=new CorsInterceptor();
registerInterceptor(corsInterceptor);
registerInterceptor(new VersionedApiConverterInterceptor());
ResponseHighlighterInterceptor responseHighlighterInterceptor=new ResponseHighlighterInterceptor();
responseHighlighterInterceptor.setShowRequestHeaders(false);
responseHighlighterInterceptor.setShowResponseHeaders(true);
registerInterceptor(responseHighlighterInterceptor);
registerInterceptor(new BanUnsupportedHttpMethodsInterceptor());
setDefaultPrettyPrint(true);
setDefaultResponseEncoding(EncodingEnum.JSON);
String baseUrl=System.getProperty(baseUrlProperty);
if (StringUtils.isBlank(baseUrl)) {
baseUrl=System.getProperty("String_Node_Str");
if (StringUtils.isBlank(baseUrl)) {
throw new ServletException("String_Node_Str" + baseUrlProperty);
}
}
setServerAddressStrategy(new MyHardcodedServerAddressStrategy(baseUrl));
setPagingProvider(myAppCtx.getBean(DatabaseBackedPagingProvider.class));
Collection<IServerInterceptor> interceptorBeans=myAppCtx.getBeansOfType(IServerInterceptor.class).values();
for (IServerInterceptor interceptor : interceptorBeans) {
this.registerInterceptor(interceptor);
}
}