@SuppressWarnings("unchecked") public void setSupplier(Injectable injectable, Supplier<?> supplier, InjectionAttributes attributes) { if (InjectableType.REFERENCE == injectable.getType() || InjectableType.CALLBACK == injectable.getType()) { setUpdatableFactory(injectable, supplier, attributes); } else { // the factory corresponds to a property or context, which will override previous values if re-injected Supplier<?> factory = factories.get(injectable); if (factory instanceof UpdatableSupplier) { ((UpdatableSupplier) factory).update(supplier); } else { factories.put(injectable, supplier); } } }
factory.setSupplier(source, new UpdatableSupplier<>(supplier));
factory.setSupplier(source, new UpdatableSupplier<>(supplier));
@SuppressWarnings("unchecked") public void setSupplier(Injectable injectable, Supplier<?> supplier, InjectionAttributes attributes) { if (InjectableType.REFERENCE == injectable.getType() || InjectableType.CALLBACK == injectable.getType()) { setUpdatableFactory(injectable, supplier, attributes); } else { // the factory corresponds to a property or context, which will override previous values if re-injected Supplier<?> factory = factories.get(injectable); if (factory instanceof UpdatableSupplier) { ((UpdatableSupplier) factory).update(supplier); } else { factories.put(injectable, supplier); } } }