Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1305

Service decorations can fail if using the conventional naming

    Details

      Description

      If you have a service FooBar and 2 modules that each have:

      public static FooBar decorateFooBar(FooBar delegate, ...)

      you will get a logging message like this:

      [WARN] com.example.services.BazModule.FooBar Could not add object with duplicate id 'FooBar'. The duplicate object has been ignored.

      which results in one of the contributions (you don't know which one) being dropped. This is because T5 uses an ordered contribution internally when collecting the contributions and bases the id of the contribution based on the method name (drops "decorate").

      It should either fail with an exception and a good error or support this behaviour. The problematic line is RegistryImpl.findDecoratorsForService (line 634).

      The work-around is to use @Match("FooBar") on the method and name it something different such as "decoratingWithMyThingy".

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                thiagohp Thiago H. de Paula Figueiredo
                Reporter:
                hagios17 Dan Adams
              • Votes:
                2 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: