Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the return type of Instance.handles() covariant
The `Instance.handles()` method returns an `Iterable` of contextual reference handles (`Instance.Handle<T>`). It used to be defined in an invariant way (`Iterable<Handle<T>>`), which prevents CDI Lite implementations from exposing subtypes of `Instance` and `Instance.Handle` as public API. This commit changes the return type to covariant `Iterable<? extends Handle<T>>`. With that change, CDI Lite implementations can expose a `CustomInstance`, which extends `Instance` and overrides the `Instance.handles()` method. The method, in turn, can return `Iterable<CustomInstanceHandle<T>>`, where `CustomInstanceHandle` extends `Instance.Handle`.
- Loading branch information