You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tiles.apache.org by "Lukasz Racon (JIRA)" <ji...@apache.org> on 2009/05/19 22:52:42 UTC

[jira] Updated: (TILES-416) wildcard order of tile definitions is not preserved

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

Lukasz Racon updated TILES-416:
-------------------------------

    Attachment: wildcard-order.patch

Map implementation, that stores tile definitions, was changed from HashMap to LinkedHashMap. We could use Map interface for API and instantiate LinkedHashMap, but this way at least intentions are visible and code compilation enforces an ordered Map.

> wildcard order of tile definitions is not preserved
> ---------------------------------------------------
>
>                 Key: TILES-416
>                 URL: https://issues.apache.org/struts/browse/TILES-416
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-core
>    Affects Versions: 2.1.2
>            Reporter: Lukasz Racon
>         Attachments: wildcard-order.patch
>
>
> Tile definitions are stored in HashMap which does not preserve the order from the tiles definition XML.
> If you define these two:
>   <definition name="test.def*.sub*" template="/test{1}.jsp">
>   <definition name="test.def*" template="/test{1}.jsp">
> and try to resolve definition name like "test.defName.subLayered" you may get either. 
> Order that depends on tile name hashCode and hash table implementation does not sound like a good idea. When table reaches load threshold it may give you different result. For example adding 13th tile definition (Hash table has default capacity: 16 and .75 load factor) triggers resize function that may reorder tile definitions - tiles that worked before may suddenly stop working.
> Same issue was reported here:
> http://markmail.org/message/cgazkho4qndlgo6d

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.