You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/02/11 22:52:00 UTC

[jira] [Commented] (TAP5-2636) Non-unique advice IDs silently override each other in random order on application startup

    [ https://issues.apache.org/jira/browse/TAP5-2636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17283424#comment-17283424 ] 

ASF subversion and git services commented on TAP5-2636:
-------------------------------------------------------

Commit 963ede88c15c19af2b3221aad8653b1e64889faf in tapestry-5's branch refs/heads/5.6.x from Thiago H. de Paula Figueiredo
[ https://gitbox.apache.org/repos/asf?p=tapestry-5.git;h=963ede8 ]

TAP5-2636: Tapestry-IoC shouldn't accept advisers with the same id

> Non-unique advice IDs silently override each other in random order on application startup
> -----------------------------------------------------------------------------------------
>
>                 Key: TAP5-2636
>                 URL: https://issues.apache.org/jira/browse/TAP5-2636
>             Project: Tapestry 5
>          Issue Type: Bug
>    Affects Versions: 5.5.0
>            Reporter: Dmitry Gusev
>            Assignee: Thiago Henrique De Paula Figueiredo
>            Priority: Major
>             Fix For: 5.6.2, 5.7.0
>
>
> Looks like Tapestry5 has had this behaviour for a long time if not always, not sure what were the reasons behind it, but it doesn't sound right and may lead to undefined behaviour.
> Maybe this is simply a misuse of the `new Orderer` constructor in the `RegistryImpl.java`: 
> {code:java}
> @Override
> public List<ServiceAdvisor> findAdvisorsForService(ServiceDef3 serviceDef)
> {
>     lock.check();
>     assert serviceDef != null;
>     Logger logger = getServiceLogger(serviceDef.getServiceId());
>     Orderer<ServiceAdvisor> orderer = new Orderer<ServiceAdvisor>(logger); // <<<<<<<<<<<< Here
>     for (Module module : moduleToServiceDefs.keySet())
> {code}
> This is not the case with decorators, their IDs are forced to be unique, the implementation passes `true` as the second argument here.
> I believe it needs fixing, but because we've had it working like this for a long time, maybe with a symbol that preserves original behaviour that should not allow duplicate IDs by default?
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)