Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.1, 1.1.1
-
None
-
None
Description
When multiply service points with same interface are visible for autowiring builer,
builder silently skips initialization of dependent service, because method
of the RegistryInfrastructureImpl return invalid information about
availability of the service for given interface. Here should be some
diagnostics message (such as "requested services for interface, but
multiply interfaces found"), possibly with error thrown (I think this is
undefined behavoir, that some requested service is multipy defined,
and someone try to lookup such service by interface only).
public boolean containsService(Class serviceInterface, Module module)
{
....
Iterator i = servicePoints.iterator();
while (i.hasNext())
/////////////////////
here is logical error, this method returns false in both cases:
- no services with given interface
- multilply services with given interface
/////////////////////
return count == 1;
}