Artificial intelligent assistant

BeanManager#resolveは何のために使用するか JavaEE`BeanManager`Bean Set<Bean<?>> beans = beanManager.getBeans(Hoge.class); Bean<?> bean = this.beanManager.resolve(beans); Object instance = beanManager.getReference(bean, Hoge.class, beanManager.createCreationalContext(bean)); Hoge hoge = (Hoge) instance; 2`BeanManager#resolve` Bean<?> bean = beans.stream().findFirst().get(); `Set`1

Weld1(beanssize1)mok2pok

BeanManagerImpl:


public Bean resolve(Set> beans) {
if (beans == null || beans.isEmpty()) {
return null;
}
Set> resolvedBeans = beanResolver.resolve(beans);
if (resolvedBeans.size() == 1) {
return resolvedBeans.iterator().next();
[]


AbstractTypeSafeBeanResolver:


public Set> resolve(Set> beans) {
if (beans.size() <= 1) {
return beans;
}
[]


> Set1

AmbiguousResolutionException1null(1)
: BeanManager.html#resolve(java.util.Set) javadoc)


(…BeanManagerSPI(Service Provider Interface)()resolve)

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 7dab8228865acdf82fc22f248e30c28a