Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InjectionPointInfo.getRequiredType() should return the type parameter for programmatic lookup #17835

Closed
mkouba opened this issue Jun 10, 2021 · 1 comment · Fixed by #17838
Closed
Assignees
Labels
area/arc Issue related to ARC (dependency injection) kind/enhancement New feature or request
Milestone

Comments

@mkouba
Copy link
Contributor

mkouba commented Jun 10, 2021

I.e. it should return Foo for @Inject javax.enterprise.inject.Instance<Foo>, @Inject io.quarkus.arc.InjectableInstance<Foo> and @Inject javax.inject.Provider<Foo>.

See https://docs.jboss.org/cdi/spec/2.0/cdi-spec.html#dynamic_lookup:
"For an injected Instance, the required type is the type parameter specified at the injection point."

We should also add the InjectionPointInfo#getType() method that would return the original type used on the injection point, e.g. this method would return Instance<Foo>.

Furthermore, we should also add InjectionPointInfo#isProgrammaticLookup() so that it's possible to filter the injection points easily.

@mkouba mkouba added the kind/enhancement New feature or request label Jun 10, 2021
@mkouba mkouba self-assigned this Jun 10, 2021
@mkouba mkouba added area/arc Issue related to ARC (dependency injection) and removed triage/needs-triage labels Jun 10, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Jun 10, 2021

/cc @manovotn

@mkouba mkouba added this to the 2.1 - main milestone Jun 10, 2021
mkouba added a commit to mkouba/quarkus that referenced this issue Jun 10, 2021
- InjectionPointInfo.getRequiredType() should return the type parameter
for programmatic lookup
- resolves quarkusio#17835
mkouba added a commit to mkouba/quarkus that referenced this issue Jun 11, 2021
- InjectionPointInfo.getRequiredType() should return the type parameter
for programmatic lookup
- resolves quarkusio#17835
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/arc Issue related to ARC (dependency injection) kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant