1. Wicket
  2. WICKET-4887

Use a Set to keep the supported wicket elements in WicketTagIdentifier


    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.9, 6.3.0
    • Fix Version/s: 6.4.0
    • Component/s: wicket
    • Labels:
    • Environment:
      Windows, Linux, Tomcat


      WicketTagIdentifier stores a private static collection of wellKnownTagNames as an ArrayList.

      and a method called isWellKnown is called from within WicketTagIdentifier.onComponentTag and presumably it's called on every Wicket tag parsed.

      private boolean isWellKnown(final ComponentTag tag)
      for (String name : wellKnownTagNames)
      if (tag.getName().equalsIgnoreCase(name))

      { return true; }

      return false;

      This method iterates over the list elements until an item is found so has O performance. If this array list was to be changed to a Set instead it would have O(1) performance.

      I haven't got any metrics on the usage and I don't think the improvement would be sensational but for web apps with large quantities of markup it could make some difference. For such a simple change it's probably worth it.


        Chris Colman created issue -
        Martin Grigorov made changes -
        Field Original Value New Value
        Summary WicketTagIdentifier optimization Use a Set to keep the supported wicket elements in WicketTagIdentifier
        Martin Grigorov made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Martin Grigorov [ mgrigorov ]
        Fix Version/s 6.4.0 [ 12323450 ]
        Resolution Fixed [ 1 ]


          • Assignee:
            Martin Grigorov
            Chris Colman
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: