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

Broken bridge method interception scenario

    XMLWordPrintable

    Details

      Description

      There is a special scenario with bridge methods where Weld will fail to correctly generate the subclass (e.g. to actually decide to intercept a bridge method).

      This can be simulated by taking our existing InterceptorBridgeMethodTest and adding the following method:

          @Test
          public void testSpecialBaseAsInterface(SpecialBase specialBase) {
              // SpecialBase extends Base<String>
              reset();
              specialBase.invokeA("foo");
              verify(SpecialParent.class);
              reset();
          }
      

      More details can be seen in Quarkus issue - https://github.com/quarkusio/quarkus/issues/14696
      And the solution will have to be very similar as well - https://github.com/quarkusio/quarkus/pull/14767

      In a nutshell, we'll have to try and detect this situation where the compiler generates a bridge without an implementation in the same class and then sign it up for interception.
      The detection will always be best-effort, but it's still better than nothing.

        Attachments

          Activity

            People

            Assignee:
            manovotn Matěj Novotný
            Reporter:
            manovotn Matěj Novotný
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: