Uploaded image for project: 'Tiles'
  1. Tiles
  2. TILES-416

wildcard order of tile definitions is not preserved

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.2
    • 2.1.3
    • tiles-core
    • None
    • Patch

    Description

      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

      Attachments

        1. wildcard-order.patch
          10 kB
          Lukasz Racon
        2. wildcard-order-map.patch
          4 kB
          Lukasz Racon

        Activity

          People

            brenmcguire Antonio Petrelli
            lukaszracon Lukasz Racon
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: