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

ObjectLocator will return wrong service implementation delegate when using markers alone

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.3.3
    • 5.4
    • tapestry-ioc
    • None

    Description

      Having the following services bound using the specified markers

      binder.bind(IServiceOne.class, ServiceOneImpl.class).withMarker(ServiceOneMarker.class);
      binder.bind(IServiceOne.class, ServiceOneSecondImpl.class).withMarker(ServiceOneSecondMarker.class);

      will cause the ObjectLocator service to return the wrong implementation class when doing this

      objectLocator.getService(IServiceOne.class, ServiceOneSecondMarker.class);

      This will return an instance of ServiceOneImpl instead of ServiceOneSecondImpl, although the marker ServiceOneSecondMarker was never registered with the ServiceOneImpl class.

      As a workaround, one must use withId(...) when binding the service interface implementation classes. In that case, the object locator will return the correct implementation class.

      Attachments

        Activity

          People

            Unassigned Unassigned
            carsten.klein Carsten Klein
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: