Whereas, if we inject a reference somewhere then it may happen that while its static type is Path, its dynamic type is gone? Correct?
For any normal scope the injected reference will be a client proxy which by definition implements/extends some or all bean types of the bean, in this case Object, Path, Comparable<Path>, Iterable<Path> and Watchable.
Wow! That is unexpected. I would even go as far as to consider that a design flaw.
Well, I wouldn't say it's a design flaw but well-defined behaviour. Also if you're programming to the interface you should not care about internal implementation details. But I understand that it's desirable in some cases, e.g. in Weld we also expect any BeanManager instance to be an Weld internal implementation. |