You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Carsten Klein (JIRA)" <ji...@apache.org> on 2012/06/08 00:41:23 UTC

[jira] [Updated] (TAP5-1954) ObjectLocator will return wrong service implementation delegate when using markers alone

     [ https://issues.apache.org/jira/browse/TAP5-1954?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Klein updated TAP5-1954:
--------------------------------

    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.


  was:
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.



    
> ObjectLocator will return wrong service implementation delegate when using markers alone
> ----------------------------------------------------------------------------------------
>
>                 Key: TAP5-1954
>                 URL: https://issues.apache.org/jira/browse/TAP5-1954
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-ioc
>    Affects Versions: 5.3.3
>            Reporter: Carsten Klein
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira