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

Interceptor resolution with multiple bindings is not done accordingly to the specification #7931

Closed
manovotn opened this issue Mar 18, 2020 · 3 comments · Fixed by #7933
Closed
Assignees
Labels
area/arc Issue related to ARC (dependency injection) kind/bug Something isn't working
Milestone

Comments

@manovotn
Copy link
Contributor

Given an interceptor with two bindings and a bean with only one of them, ArC currently triggers the interceptor for methods on that bean. This is not what the specification expects, it should only trigger if bean has both bindings.

@manovotn manovotn added kind/bug Something isn't working area/arc Issue related to ARC (dependency injection) labels Mar 18, 2020
@manovotn manovotn self-assigned this Mar 18, 2020
@mkouba mkouba added this to the 1.4.0 milestone Mar 18, 2020
@loicmathieu
Copy link
Contributor

@manovotn are you sure because the following reference documentation on Weld say it's correct: https://docs.jboss.org/weld/reference/1.0.0/en-US/html/interceptors.html#d0e3567

It clearly say that if an interceptor has multiple annotation bindings using any of the annotation will triggers it.

@manovotn
Copy link
Contributor Author

@loicmathieu yes I am sure.

That doc is pretty old (Weld 1) BTW, Weld 3 has the docs here - https://docs.jboss.org/weld/reference/latest/en-US/html_single/#_multiple_interceptor_binding_annotations
However, most of this is written in interceptor spec doc, which seems to be broken now. CDI only adds few bits on top of it.

And looking at that doc, note that the resulting method always has both annotations. In interceptor spec, you combine annotations from class-level with those on method-level for resulting set of bindings. Therefore, with 2 bindings you have 4 combination of declaring them - either both bindings on class/method level or one binding on class, the other on method.

@loicmathieu
Copy link
Contributor

Oh my bad !

I read too quickly the documentation and as I saw something different I read it ... the way I see it :)

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/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants