Program: 51138
Project: 51138
Buggy source:
private void _initiate(final ResourceConfig rc,final IoCComponentProviderFactory _provider){
  if (rc == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (initiated) {
    throw new ContainerException(ImplMessages.WEB_APP_ALREADY_INITIATED());
  }
  this.initiated=true;
  LOGGER.info("String_Node_Str" + BuildId.getBuildId() + "String_Node_Str");
  Class<?>[] components=ServiceFinder.find("String_Node_Str").toClassArray();
  if (components.length > 0) {
    if (LOGGER.isLoggable(Level.INFO)) {
      StringBuilder b=new StringBuilder();
      b.append("String_Node_Str");
      for (      Class c : components)       b.append('\n').append("String_Node_Str").append(c);
      LOGGER.log(Level.INFO,b.toString());
    }
    this.resourceConfig=rc.clone();
    this.resourceConfig.getClasses().addAll(Arrays.asList(components));
  }
 else {
    this.resourceConfig=rc;
  }
  this.provider=_provider;
  this.providerFactories=new ArrayList<IoCComponentProviderFactory>(2);
  for (  Object o : resourceConfig.getProviderSingletons()) {
    if (o instanceof IoCComponentProviderFactory) {
      providerFactories.add((IoCComponentProviderFactory)o);
    }
  }
  if (_provider != null)   providerFactories.add(_provider);
  this.cpFactory=(providerFactories.isEmpty()) ? new ProviderFactory(injectableFactory) : new IoCProviderFactory(injectableFactory,providerFactories);
  this.rcpFactory=(providerFactories.isEmpty()) ? new ResourceFactory(this.resourceConfig,this.injectableFactory) : new IoCResourceFactory(this.resourceConfig,this.injectableFactory,providerFactories);
  for (  IoCComponentProviderFactory f : providerFactories) {
    IoCComponentProcessorFactory cpf=null;
    if (f instanceof IoCComponentProcessorFactoryInitializer) {
      if (cpf == null) {
        cpf=new ComponentProcessorFactoryImpl();
      }
      IoCComponentProcessorFactoryInitializer i=(IoCComponentProcessorFactoryInitializer)f;
      i.init(cpf);
    }
  }
  this.resourceContext=new ResourceContext(){
    public ExtendedUriInfo matchUriInfo(    URI u) throws ContainerException {
      try {
        return handleMatchResourceRequest(u);
      }
 catch (      ContainerException ex) {
        throw ex;
      }
catch (      WebApplicationException ex) {
        if (ex.getResponse().getStatus() == 404) {
          return null;
        }
 else {
          throw new ContainerException(ex);
        }
      }
catch (      RuntimeException ex) {
        throw new ContainerException(ex);
      }
    }
    public Object matchResource(    URI u) throws ContainerException {
      ExtendedUriInfo ui=matchUriInfo(u);
      return (ui != null) ? ui.getMatchedResources().get(0) : null;
    }
    public <T>T matchResource(    URI u,    Class<T> c) throws ContainerException, ClassCastException {
      return c.cast(matchResource(u));
    }
    public <T>T getResource(    Class<T> c){
      return c.cast(getResourceComponentProvider(c).getInstance(context));
    }
  }
;
  ProviderServices providerServices=new ProviderServices(ServerSide.class,this.cpFactory,resourceConfig.getProviderClasses(),resourceConfig.getProviderSingletons());
  injectableFactory.add(new InjectableProvider<ParentRef,Type>(){
    public ComponentScope getScope(){
      return ComponentScope.PerRequest;
    }
    public Injectable<Object> getInjectable(    ComponentContext cc,    ParentRef a,    Type t){
      if (!(t instanceof Class))       return null;
      final Class target=ReflectionHelper.getDeclaringClass(cc.getAccesibleObject());
      final Class inject=(Class)t;
      return new Injectable<Object>(){
        public Object getValue(){
          final UriInfo ui=context.getUriInfo();
          final List l=ui.getMatchedResources();
          final Object parent=getParent(l,target);
          if (parent == null)           return null;
          try {
            return inject.cast(parent);
          }
 catch (          ClassCastException ex) {
            throw new ContainerException("String_Node_Str" + inject.getName() + "String_Node_Str"+ l.get(1).getClass().getName(),ex);
          }
        }
        private Object getParent(        List l,        Class target){
          if (l.isEmpty()) {
            return null;
          }
 else           if (l.size() == 1) {
            return (l.get(0).getClass() == target) ? null : l.get(0);
          }
 else {
            return (l.get(0).getClass() == target) ? l.get(1) : l.get(0);
          }
        }
      }
;
    }
  }
);
  injectableFactory.add(new InjectableProvider<Inject,Type>(){
    public ComponentScope getScope(){
      return ComponentScope.PerRequest;
    }
    public Injectable<Object> getInjectable(    ComponentContext cc,    Inject a,    Type t){
      if (!(t instanceof Class))       return null;
      final ResourceComponentProvider rcp=getResourceComponentProvider(cc,(Class)t);
      return new Injectable<Object>(){
        public Object getValue(){
          return rcp.getInstance(context);
        }
      }
;
    }
  }
);
  injectableFactory.add(new InjectableProvider<Inject,Type>(){
    public ComponentScope getScope(){
      return ComponentScope.Undefined;
    }
    public Injectable<Object> getInjectable(    ComponentContext cc,    Inject a,    Type t){
      if (!(t instanceof Class))       return null;
      final ResourceComponentProvider rcp=getResourceComponentProvider(cc,(Class)t);
      if (rcp.getScope() == ComponentScope.PerRequest)       return null;
      return new Injectable<Object>(){
        public Object getValue(){
          return rcp.getInstance(context);
        }
      }
;
    }
  }
);
  injectableFactory.add(new InjectableProvider<Inject,Type>(){
    public ComponentScope getScope(){
      return ComponentScope.Singleton;
    }
    public Injectable<Object> getInjectable(    ComponentContext cc,    Inject a,    Type t){
      if (!(t instanceof Class))       return null;
      final ResourceComponentProvider rcp=getResourceComponentProvider(cc,(Class)t);
      if (rcp.getScope() != ComponentScope.Singleton)       return null;
      return new Injectable<Object>(){
        public Object getValue(){
          return rcp.getInstance(context);
        }
      }
;
    }
  }
);
  injectableFactory.add(new InjectableProvider<InjectParam,Type>(){
    public ComponentScope getScope(){
      return ComponentScope.PerRequest;
    }
    public Injectable<Object> getInjectable(    ComponentContext cc,    InjectParam a,    Type t){
      if (!(t instanceof Class))       return null;
      final ResourceComponentProvider rcp=getResourceComponentProvider(cc,(Class)t);
      return new Injectable<Object>(){
        public Object getValue(){
          return rcp.getInstance(context);
        }
      }
;
    }
  }
);
  injectableFactory.add(new InjectableProvider<InjectParam,Type>(){
    public ComponentScope getScope(){
      return ComponentScope.Undefined;
    }
    public Injectable<Object> getInjectable(    ComponentContext cc,    InjectParam a,    Type t){
      if (!(t instanceof Class))       return null;
      final ResourceComponentProvider rcp=getResourceComponentProvider(cc,(Class)t);
      if (rcp.getScope() == ComponentScope.PerRequest)       return null;
      return new Injectable<Object>(){
        public Object getValue(){
          return rcp.getInstance(context);
        }
      }
;
    }
  }
);
  injectableFactory.add(new InjectableProvider<InjectParam,Type>(){
    public ComponentScope getScope(){
      return ComponentScope.Singleton;
    }
    public Injectable<Object> getInjectable(    ComponentContext cc,    InjectParam a,    Type t){
      if (!(t instanceof Class))       return null;
      final ResourceComponentProvider rcp=getResourceComponentProvider(cc,(Class)t);
      if (rcp.getScope() != ComponentScope.Singleton)       return null;
      return new Injectable<Object>(){
        public Object getValue(){
          return rcp.getInstance(context);
        }
      }
;
    }
  }
);
  injectableFactory.add(new ContextInjectableProvider<FeaturesAndProperties>(FeaturesAndProperties.class,resourceConfig));
  injectableFactory.add(new InjectableProvider<Context,Type>(){
    public ComponentScope getScope(){
      return ComponentScope.Singleton;
    }
    public Injectable<ResourceConfig> getInjectable(    ComponentContext cc,    Context a,    Type t){
      if (t != ResourceConfig.class)       return null;
      return new Injectable<ResourceConfig>(){
        public ResourceConfig getValue(){
          return resourceConfig;
        }
      }
;
    }
  }
);
  injectableFactory.add(new ContextInjectableProvider<ResourceContext>(ResourceContext.class,resourceContext));
  injectableFactory.configure(providerServices);
  boolean updateRequired=false;
  if (rc instanceof DeferredResourceConfig) {
    final DeferredResourceConfig drc=(DeferredResourceConfig)rc;
    if (resourceConfig == drc)     resourceConfig=drc.clone();
    final DeferredResourceConfig.ApplicationHolder da=drc.getApplication(cpFactory);
    resourceConfig.add(da.getApplication());
    updateRequired=true;
    injectableFactory.add(new ContextInjectableProvider<Application>(Application.class,da.getOriginalApplication()));
  }
 else {
    injectableFactory.add(new ContextInjectableProvider<FeaturesAndProperties>(Application.class,resourceConfig));
  }
  for (  ResourceConfigurator configurator : providerServices.getProviders(ResourceConfigurator.class)) {
    configurator.configure(this.resourceConfig);
    updateRequired=true;
  }
  this.resourceConfig.validate();
  if (updateRequired) {
    providerServices.update(resourceConfig.getProviderClasses(),resourceConfig.getProviderSingletons(),injectableFactory);
  }
  this.templateContext=new TemplateFactory(providerServices);
  injectableFactory.add(new ContextInjectableProvider<TemplateContext>(TemplateContext.class,templateContext));
  final ContextResolverFactory crf=new ContextResolverFactory();
  this.exceptionFactory=new ExceptionMapperFactory();
  this.bodyFactory=new MessageBodyFactory(providerServices,getFeaturesAndProperties().getFeature(FeaturesAndProperties.FEATURE_PRE_1_4_PROVIDER_PRECEDENCE));
  injectableFactory.add(new ContextInjectableProvider<MessageBodyWorkers>(MessageBodyWorkers.class,bodyFactory));
  this.providers=new Providers(){
    public <T>MessageBodyReader<T> getMessageBodyReader(    Class<T> c,    Type t,    Annotation[] as,    MediaType m){
      return bodyFactory.getMessageBodyReader(c,t,as,m);
    }
    public <T>MessageBodyWriter<T> getMessageBodyWriter(    Class<T> c,    Type t,    Annotation[] as,    MediaType m){
      return bodyFactory.getMessageBodyWriter(c,t,as,m);
    }
    public <T extends Throwable>ExceptionMapper<T> getExceptionMapper(    Class<T> c){
      if (Throwable.class.isAssignableFrom(c))       return exceptionFactory.find((Class<Throwable>)c);
 else       return null;
    }
    public <T>ContextResolver<T> getContextResolver(    Class<T> ct,    MediaType m){
      return crf.resolve(ct,m);
    }
  }
;
  injectableFactory.add(new ContextInjectableProvider<Providers>(Providers.class,providers));
  this.stringReaderFactory=new StringReaderFactory();
  injectableFactory.add(new ContextInjectableProvider<StringReaderWorkers>(StringReaderWorkers.class,stringReaderFactory));
  MultivaluedParameterExtractorProvider mpep=new MultivaluedParameterExtractorFactory(stringReaderFactory);
  injectableFactory.add(new ContextInjectableProvider<MultivaluedParameterExtractorProvider>(MultivaluedParameterExtractorProvider.class,mpep));
  injectableFactory.add(new CookieParamInjectableProvider(mpep));
  injectableFactory.add(new HeaderParamInjectableProvider(mpep));
  injectableFactory.add(new HttpContextInjectableProvider());
  injectableFactory.add(new MatrixParamInjectableProvider(mpep));
  injectableFactory.add(new PathParamInjectableProvider(mpep));
  injectableFactory.add(new QueryParamInjectableProvider(mpep));
  injectableFactory.add(new FormParamInjectableProvider(mpep));
  filterFactory=new FilterFactory(providerServices);
  dispatcherFactory=ResourceMethodDispatcherFactory.create(providerServices);
  this.wadlFactory=new WadlFactory(resourceConfig);
  filterFactory.init(resourceConfig);
  if (!resourceConfig.getMediaTypeMappings().isEmpty() || !resourceConfig.getLanguageMappings().isEmpty()) {
    boolean present=false;
    for (    ContainerRequestFilter f : filterFactory.getRequestFilters()) {
      present|=f instanceof UriConnegFilter;
    }
    if (!present) {
      filterFactory.getRequestFilters().add(new UriConnegFilter(resourceConfig.getMediaTypeMappings(),resourceConfig.getLanguageMappings()));
    }
 else {
      LOGGER.warning("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + UriConnegFilter.class.getName() + "String_Node_Str");
    }
  }
  crf.init(providerServices,injectableFactory);
  exceptionFactory.init(providerServices);
  bodyFactory.init();
  stringReaderFactory.init(providerServices);
  Errors.setReportMissingDependentFieldOrMethod(true);
  cpFactory.injectOnAllComponents();
  cpFactory.injectOnProviderInstances(resourceConfig.getProviderSingletons());
  for (  IoCComponentProviderFactory providerFactory : providerFactories) {
    if (providerFactory instanceof WebApplicationListener) {
      WebApplicationListener listener=(WebApplicationListener)providerFactory;
      listener.onWebApplicationReady();
    }
  }
  RulesMap<UriRule> rootRules=new RootResourceUriRules(this,resourceConfig,wadlFactory,injectableFactory).getRules();
  this.rootsRule=new RootResourceClassesRule(rootRules);
  this.isTraceEnabled=resourceConfig.getFeature(ResourceConfig.FEATURE_TRACE) | resourceConfig.getFeature(ResourceConfig.FEATURE_TRACE_PER_REQUEST);
}

Fixed version (ground truth):
private void _initiate(final ResourceConfig rc,final IoCComponentProviderFactory _provider){
  if (rc == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (initiated) {
    throw new ContainerException(ImplMessages.WEB_APP_ALREADY_INITIATED());
  }
  this.initiated=true;
  LOGGER.info("String_Node_Str" + BuildId.getBuildId() + "String_Node_Str");
  Class<?>[] components=ServiceFinder.find("String_Node_Str").toClassArray();
  if (components.length > 0) {
    if (LOGGER.isLoggable(Level.INFO)) {
      StringBuilder b=new StringBuilder();
      b.append("String_Node_Str");
      for (      Class c : components)       b.append('\n').append("String_Node_Str").append(c);
      LOGGER.log(Level.INFO,b.toString());
    }
    this.resourceConfig=rc.clone();
    this.resourceConfig.getClasses().addAll(Arrays.asList(components));
  }
 else {
    this.resourceConfig=rc;
  }
  this.provider=_provider;
  this.providerFactories=new ArrayList<IoCComponentProviderFactory>(2);
  for (  Object o : resourceConfig.getProviderSingletons()) {
    if (o instanceof IoCComponentProviderFactory) {
      providerFactories.add((IoCComponentProviderFactory)o);
    }
  }
  if (_provider != null)   providerFactories.add(_provider);
  this.cpFactory=(providerFactories.isEmpty()) ? new ProviderFactory(injectableFactory) : new IoCProviderFactory(injectableFactory,providerFactories);
  this.rcpFactory=(providerFactories.isEmpty()) ? new ResourceFactory(this.resourceConfig,this.injectableFactory) : new IoCResourceFactory(this.resourceConfig,this.injectableFactory,providerFactories);
  for (  IoCComponentProviderFactory f : providerFactories) {
    IoCComponentProcessorFactory cpf=null;
    if (f instanceof IoCComponentProcessorFactoryInitializer) {
      if (cpf == null) {
        cpf=new ComponentProcessorFactoryImpl();
      }
      IoCComponentProcessorFactoryInitializer i=(IoCComponentProcessorFactoryInitializer)f;
      i.init(cpf);
    }
  }
  this.resourceContext=new ResourceContext(){
    public ExtendedUriInfo matchUriInfo(    URI u) throws ContainerException {
      try {
        return handleMatchResourceRequest(u);
      }
 catch (      ContainerException ex) {
        throw ex;
      }
catch (      WebApplicationException ex) {
        if (ex.getResponse().getStatus() == 404) {
          return null;
        }
 else {
          throw new ContainerException(ex);
        }
      }
catch (      RuntimeException ex) {
        throw new ContainerException(ex);
      }
    }
    public Object matchResource(    URI u) throws ContainerException {
      ExtendedUriInfo ui=matchUriInfo(u);
      return (ui != null) ? ui.getMatchedResources().get(0) : null;
    }
    public <T>T matchResource(    URI u,    Class<T> c) throws ContainerException, ClassCastException {
      return c.cast(matchResource(u));
    }
    public <T>T getResource(    Class<T> c){
      return c.cast(getResourceComponentProvider(c).getInstance(context));
    }
  }
;
  ProviderServices providerServices=new ProviderServices(ServerSide.class,this.cpFactory,resourceConfig.getProviderClasses(),resourceConfig.getProviderSingletons());
  injectableFactory.add(new ContextInjectableProvider<ProviderServices>(ProviderServices.class,providerServices));
  injectableFactory.add(new InjectableProvider<ParentRef,Type>(){
    public ComponentScope getScope(){
      return ComponentScope.PerRequest;
    }
    public Injectable<Object> getInjectable(    ComponentContext cc,    ParentRef a,    Type t){
      if (!(t instanceof Class))       return null;
      final Class target=ReflectionHelper.getDeclaringClass(cc.getAccesibleObject());
      final Class inject=(Class)t;
      return new Injectable<Object>(){
        public Object getValue(){
          final UriInfo ui=context.getUriInfo();
          final List l=ui.getMatchedResources();
          final Object parent=getParent(l,target);
          if (parent == null)           return null;
          try {
            return inject.cast(parent);
          }
 catch (          ClassCastException ex) {
            throw new ContainerException("String_Node_Str" + inject.getName() + "String_Node_Str"+ l.get(1).getClass().getName(),ex);
          }
        }
        private Object getParent(        List l,        Class target){
          if (l.isEmpty()) {
            return null;
          }
 else           if (l.size() == 1) {
            return (l.get(0).getClass() == target) ? null : l.get(0);
          }
 else {
            return (l.get(0).getClass() == target) ? l.get(1) : l.get(0);
          }
        }
      }
;
    }
  }
);
  injectableFactory.add(new InjectableProvider<Inject,Type>(){
    public ComponentScope getScope(){
      return ComponentScope.PerRequest;
    }
    public Injectable<Object> getInjectable(    ComponentContext cc,    Inject a,    Type t){
      if (!(t instanceof Class))       return null;
      final ResourceComponentProvider rcp=getResourceComponentProvider(cc,(Class)t);
      return new Injectable<Object>(){
        public Object getValue(){
          return rcp.getInstance(context);
        }
      }
;
    }
  }
);
  injectableFactory.add(new InjectableProvider<Inject,Type>(){
    public ComponentScope getScope(){
      return ComponentScope.Undefined;
    }
    public Injectable<Object> getInjectable(    ComponentContext cc,    Inject a,    Type t){
      if (!(t instanceof Class))       return null;
      final ResourceComponentProvider rcp=getResourceComponentProvider(cc,(Class)t);
      if (rcp.getScope() == ComponentScope.PerRequest)       return null;
      return new Injectable<Object>(){
        public Object getValue(){
          return rcp.getInstance(context);
        }
      }
;
    }
  }
);
  injectableFactory.add(new InjectableProvider<Inject,Type>(){
    public ComponentScope getScope(){
      return ComponentScope.Singleton;
    }
    public Injectable<Object> getInjectable(    ComponentContext cc,    Inject a,    Type t){
      if (!(t instanceof Class))       return null;
      final ResourceComponentProvider rcp=getResourceComponentProvider(cc,(Class)t);
      if (rcp.getScope() != ComponentScope.Singleton)       return null;
      return new Injectable<Object>(){
        public Object getValue(){
          return rcp.getInstance(context);
        }
      }
;
    }
  }
);
  injectableFactory.add(new InjectableProvider<InjectParam,Type>(){
    public ComponentScope getScope(){
      return ComponentScope.PerRequest;
    }
    public Injectable<Object> getInjectable(    ComponentContext cc,    InjectParam a,    Type t){
      if (!(t instanceof Class))       return null;
      final ResourceComponentProvider rcp=getResourceComponentProvider(cc,(Class)t);
      return new Injectable<Object>(){
        public Object getValue(){
          return rcp.getInstance(context);
        }
      }
;
    }
  }
);
  injectableFactory.add(new InjectableProvider<InjectParam,Type>(){
    public ComponentScope getScope(){
      return ComponentScope.Undefined;
    }
    public Injectable<Object> getInjectable(    ComponentContext cc,    InjectParam a,    Type t){
      if (!(t instanceof Class))       return null;
      final ResourceComponentProvider rcp=getResourceComponentProvider(cc,(Class)t);
      if (rcp.getScope() == ComponentScope.PerRequest)       return null;
      return new Injectable<Object>(){
        public Object getValue(){
          return rcp.getInstance(context);
        }
      }
;
    }
  }
);
  injectableFactory.add(new InjectableProvider<InjectParam,Type>(){
    public ComponentScope getScope(){
      return ComponentScope.Singleton;
    }
    public Injectable<Object> getInjectable(    ComponentContext cc,    InjectParam a,    Type t){
      if (!(t instanceof Class))       return null;
      final ResourceComponentProvider rcp=getResourceComponentProvider(cc,(Class)t);
      if (rcp.getScope() != ComponentScope.Singleton)       return null;
      return new Injectable<Object>(){
        public Object getValue(){
          return rcp.getInstance(context);
        }
      }
;
    }
  }
);
  injectableFactory.add(new ContextInjectableProvider<FeaturesAndProperties>(FeaturesAndProperties.class,resourceConfig));
  injectableFactory.add(new InjectableProvider<Context,Type>(){
    public ComponentScope getScope(){
      return ComponentScope.Singleton;
    }
    public Injectable<ResourceConfig> getInjectable(    ComponentContext cc,    Context a,    Type t){
      if (t != ResourceConfig.class)       return null;
      return new Injectable<ResourceConfig>(){
        public ResourceConfig getValue(){
          return resourceConfig;
        }
      }
;
    }
  }
);
  injectableFactory.add(new ContextInjectableProvider<ResourceContext>(ResourceContext.class,resourceContext));
  injectableFactory.configure(providerServices);
  boolean updateRequired=false;
  if (rc instanceof DeferredResourceConfig) {
    final DeferredResourceConfig drc=(DeferredResourceConfig)rc;
    if (resourceConfig == drc)     resourceConfig=drc.clone();
    final DeferredResourceConfig.ApplicationHolder da=drc.getApplication(cpFactory);
    resourceConfig.add(da.getApplication());
    updateRequired=true;
    injectableFactory.add(new ContextInjectableProvider<Application>(Application.class,da.getOriginalApplication()));
  }
 else {
    injectableFactory.add(new ContextInjectableProvider<FeaturesAndProperties>(Application.class,resourceConfig));
  }
  for (  ResourceConfigurator configurator : providerServices.getProviders(ResourceConfigurator.class)) {
    configurator.configure(this.resourceConfig);
    updateRequired=true;
  }
  this.resourceConfig.validate();
  if (updateRequired) {
    providerServices.update(resourceConfig.getProviderClasses(),resourceConfig.getProviderSingletons(),injectableFactory);
  }
  this.templateContext=new TemplateFactory(providerServices);
  injectableFactory.add(new ContextInjectableProvider<TemplateContext>(TemplateContext.class,templateContext));
  final ContextResolverFactory crf=new ContextResolverFactory();
  this.exceptionFactory=new ExceptionMapperFactory();
  this.bodyFactory=new MessageBodyFactory(providerServices,getFeaturesAndProperties().getFeature(FeaturesAndProperties.FEATURE_PRE_1_4_PROVIDER_PRECEDENCE));
  injectableFactory.add(new ContextInjectableProvider<MessageBodyWorkers>(MessageBodyWorkers.class,bodyFactory));
  this.providers=new Providers(){
    public <T>MessageBodyReader<T> getMessageBodyReader(    Class<T> c,    Type t,    Annotation[] as,    MediaType m){
      return bodyFactory.getMessageBodyReader(c,t,as,m);
    }
    public <T>MessageBodyWriter<T> getMessageBodyWriter(    Class<T> c,    Type t,    Annotation[] as,    MediaType m){
      return bodyFactory.getMessageBodyWriter(c,t,as,m);
    }
    public <T extends Throwable>ExceptionMapper<T> getExceptionMapper(    Class<T> c){
      if (Throwable.class.isAssignableFrom(c))       return exceptionFactory.find((Class<Throwable>)c);
 else       return null;
    }
    public <T>ContextResolver<T> getContextResolver(    Class<T> ct,    MediaType m){
      return crf.resolve(ct,m);
    }
  }
;
  injectableFactory.add(new ContextInjectableProvider<Providers>(Providers.class,providers));
  this.stringReaderFactory=new StringReaderFactory();
  injectableFactory.add(new ContextInjectableProvider<StringReaderWorkers>(StringReaderWorkers.class,stringReaderFactory));
  MultivaluedParameterExtractorProvider mpep=new MultivaluedParameterExtractorFactory(stringReaderFactory);
  injectableFactory.add(new ContextInjectableProvider<MultivaluedParameterExtractorProvider>(MultivaluedParameterExtractorProvider.class,mpep));
  injectableFactory.add(new CookieParamInjectableProvider(mpep));
  injectableFactory.add(new HeaderParamInjectableProvider(mpep));
  injectableFactory.add(new HttpContextInjectableProvider());
  injectableFactory.add(new MatrixParamInjectableProvider(mpep));
  injectableFactory.add(new PathParamInjectableProvider(mpep));
  injectableFactory.add(new QueryParamInjectableProvider(mpep));
  injectableFactory.add(new FormParamInjectableProvider(mpep));
  filterFactory=new FilterFactory(providerServices);
  dispatcherFactory=ResourceMethodDispatcherFactory.create(providerServices);
  this.wadlFactory=new WadlFactory(resourceConfig);
  filterFactory.init(resourceConfig);
  if (!resourceConfig.getMediaTypeMappings().isEmpty() || !resourceConfig.getLanguageMappings().isEmpty()) {
    boolean present=false;
    for (    ContainerRequestFilter f : filterFactory.getRequestFilters()) {
      present|=f instanceof UriConnegFilter;
    }
    if (!present) {
      filterFactory.getRequestFilters().add(new UriConnegFilter(resourceConfig.getMediaTypeMappings(),resourceConfig.getLanguageMappings()));
    }
 else {
      LOGGER.warning("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + UriConnegFilter.class.getName() + "String_Node_Str");
    }
  }
  crf.init(providerServices,injectableFactory);
  exceptionFactory.init(providerServices);
  bodyFactory.init();
  stringReaderFactory.init(providerServices);
  Errors.setReportMissingDependentFieldOrMethod(true);
  cpFactory.injectOnAllComponents();
  cpFactory.injectOnProviderInstances(resourceConfig.getProviderSingletons());
  for (  IoCComponentProviderFactory providerFactory : providerFactories) {
    if (providerFactory instanceof WebApplicationListener) {
      WebApplicationListener listener=(WebApplicationListener)providerFactory;
      listener.onWebApplicationReady();
    }
  }
  RulesMap<UriRule> rootRules=new RootResourceUriRules(this,resourceConfig,wadlFactory,injectableFactory).getRules();
  this.rootsRule=new RootResourceClassesRule(rootRules);
  this.isTraceEnabled=resourceConfig.getFeature(ResourceConfig.FEATURE_TRACE) | resourceConfig.getFeature(ResourceConfig.FEATURE_TRACE_PER_REQUEST);
}