Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2661

Correct usage of @Repeatable @InterceptorBinding

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Major Major
    • None
    • 3.1.7.Final
    • None
    • Undefined

      I have a weird behavior when using @Repeatable @InterceptorBinding.

      Let's define the @MyBinding @InterceptorBinding (which is @Repeatable(MyBindings.class)) and the @MyBindings @InterceptorBinding.

      If I have 1 interceptor for @MyBinding only, then a method which is annotated with multiple @MyBinding will be intercepted for the first @MyBinding only (other @MyBinding are ignored).

      If I have 1 interceptor for @MyBindings only, then a method which is annotated with a single @MyBinding will not be intercepted at all.

      If I have 2 interceptors for both @MyBinding and @MyBindings, then a method which is annotated with multiple @MyBinding will be intercepted by both interceptors (once with the first interceptor with only the first @MyBinding and once with the second interceptor with @MyBindings)

      So it's not clear if we have to use 1 or 2 different interceptors for @Repeatable @InterceptorBinding as none seems to give the expected result.

      Note: I am using WeldInvocationContext.getInterceptorBindings() to retrieve the bindings in my interceptors.

              Unassigned Unassigned
              xavierdury Xavier Dury (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: