throw errors.toException(); return createJustInTimeBindingRecursive(key, errors, options.jitDisabled, jitType);
return parent.createJustInTimeBindingRecursive( key, new Errors(),
/** * Returns a just-in-time binding for {@code key}, creating it if necessary. * * @throws ErrorsException if the binding could not be created. */ private <T> BindingImpl<T> getJustInTimeBinding(Key<T> key, Errors errors, JitLimitation jitType) throws ErrorsException { boolean jitOverride = isProvider(key) || isTypeLiteral(key) || isMembersInjector(key); synchronized (state.lock()) { // first try to find a JIT binding that we've already created for (InjectorImpl injector = this; injector != null; injector = injector.parent) { @SuppressWarnings("unchecked") // we only store bindings that match their key BindingImpl<T> binding = (BindingImpl<T>) injector.jitBindings.get(key); if (binding != null) { // If we found a JIT binding and we don't allow them, // fail. (But allow bindings created through TypeConverters.) if (options.jitDisabled && jitType == JitLimitation.NO_JIT && !jitOverride && !(binding instanceof ConvertedConstantBindingImpl)) { throw errors.jitDisabled(key).toException(); } else { return binding; } } } return createJustInTimeBindingRecursive(key, errors, options.jitDisabled, jitType); } }
/** * Returns a just-in-time binding for {@code key}, creating it if necessary. * * @throws ErrorsException if the binding could not be created. */ private <T> BindingImpl<T> getJustInTimeBinding(Key<T> key, Errors errors, JitLimitation jitType) throws ErrorsException { boolean jitOverride = isProvider(key) || isTypeLiteral(key) || isMembersInjector(key); synchronized (state.lock()) { // first try to find a JIT binding that we've already created for (InjectorImpl injector = this; injector != null; injector = injector.parent) { @SuppressWarnings("unchecked") // we only store bindings that match their key BindingImpl<T> binding = (BindingImpl<T>) injector.jitBindings.get(key); if (binding != null) { // If we found a JIT binding and we don't allow them, // fail. (But allow bindings created through TypeConverters.) if (options.jitDisabled && jitType == JitLimitation.NO_JIT && !jitOverride && !(binding instanceof ConvertedConstantBindingImpl)) { throw errors.jitDisabled(key).toException(); } else { return binding; } } } return createJustInTimeBindingRecursive(key, errors, options.jitDisabled, jitType); } }
/** * Returns a just-in-time binding for {@code key}, creating it if necessary. * * @throws ErrorsException if the binding could not be created. */ private <T> BindingImpl<T> getJustInTimeBinding(Key<T> key, Errors errors, JitLimitation jitType) throws ErrorsException { boolean jitOverride = isProvider(key) || isTypeLiteral(key) || isMembersInjector(key); synchronized (state.lock()) { // first try to find a JIT binding that we've already created for (InjectorImpl injector = this; injector != null; injector = injector.parent) { @SuppressWarnings("unchecked") // we only store bindings that match their key BindingImpl<T> binding = (BindingImpl<T>) injector.jitBindings.get(key); if (binding != null) { // If we found a JIT binding and we don't allow them, // fail. (But allow bindings created through TypeConverters.) if (options.jitDisabled && jitType == JitLimitation.NO_JIT && !jitOverride && !(binding instanceof ConvertedConstantBindingImpl)) { throw errors.jitDisabled(key).toException(); } else { return binding; } } } return createJustInTimeBindingRecursive(key, errors, options.jitDisabled, jitType); } }
throw errors.toException(); return createJustInTimeBindingRecursive(key, errors, options.jitDisabled, jitType);
throw errors.toException(); return createJustInTimeBindingRecursive(key, errors, options.jitDisabled, jitType);
throw errors.toException(); return createJustInTimeBindingRecursive(key, errors, options.jitDisabled, jitType);
/** * Attempts to create a just-in-time binding for {@code key} in the root injector, falling back to * other ancestor injectors until this injector is tried. */ private <T> BindingImpl<T> createJustInTimeBindingRecursive(Key<T> key, Errors errors, boolean jitDisabled, JitLimitation jitType) throws ErrorsException { // ask the parent to create the JIT binding if (parent != null) { try { return parent.createJustInTimeBindingRecursive(key, new Errors(), jitDisabled, parent.options.jitDisabled ? JitLimitation.NO_JIT : jitType); } catch (ErrorsException ignored) { } } if (state.isBlacklisted(key)) { Set<Object> sources = state.getSourcesForBlacklistedKey(key); throw errors.childBindingAlreadySet(key, sources).toException(); } BindingImpl<T> binding = createJustInTimeBinding(key, errors, jitDisabled, jitType); state.parent().blacklist(key, binding.getSource()); jitBindings.put(key, binding); return binding; }
/** * Attempts to create a just-in-time binding for {@code key} in the root injector, falling back to * other ancestor injectors until this injector is tried. */ private <T> BindingImpl<T> createJustInTimeBindingRecursive(Key<T> key, Errors errors, boolean jitDisabled, JitLimitation jitType) throws ErrorsException { // ask the parent to create the JIT binding if (parent != null) { try { return parent.createJustInTimeBindingRecursive(key, new Errors(), jitDisabled, parent.options.jitDisabled ? JitLimitation.NO_JIT : jitType); } catch (ErrorsException ignored) { } } if (state.isBlacklisted(key)) { Set<Object> sources = state.getSourcesForBlacklistedKey(key); throw errors.childBindingAlreadySet(key, sources).toException(); } BindingImpl<T> binding = createJustInTimeBinding(key, errors, jitDisabled, jitType); state.parent().blacklist(key, binding.getSource()); jitBindings.put(key, binding); return binding; }
/** * Attempts to create a just-in-time binding for {@code key} in the root injector, falling back to * other ancestor injectors until this injector is tried. */ private <T> BindingImpl<T> createJustInTimeBindingRecursive(Key<T> key, Errors errors, boolean jitDisabled, JitLimitation jitType) throws ErrorsException { // ask the parent to create the JIT binding if (parent != null) { try { return parent.createJustInTimeBindingRecursive(key, new Errors(), jitDisabled, parent.options.jitDisabled ? JitLimitation.NO_JIT : jitType); } catch (ErrorsException ignored) { } } if (state.isBlacklisted(key)) { Set<Object> sources = state.getSourcesForBlacklistedKey(key); throw errors.childBindingAlreadySet(key, sources).toException(); } BindingImpl<T> binding = createJustInTimeBinding(key, errors, jitDisabled, jitType); state.parent().blacklist(key, binding.getSource()); jitBindings.put(key, binding); return binding; }
return parent.createJustInTimeBindingRecursive(key, new Errors(), jitDisabled, parent.options.jitDisabled ? JitLimitation.NO_JIT : jitType); } catch (ErrorsException ignored) {
return parent.createJustInTimeBindingRecursive( key, new Errors(),
return parent.createJustInTimeBindingRecursive( key, new Errors(),