Wicket
  1. Wicket
  2. WICKET-1361

Localizer doesn't honor style when caching property lookups

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.3.2
    • Component/s: wicket
    • Labels:
      None

      Description

      In Wicket 1.2.6, we created some properties files like:

      Foo.properties
      Foo_style1.properties
      Foo_style2.properties

      and used StringResourceModel to look up property values. This worked correctly as in 1.2.6, Localizer didn't cache the property lookups and respected the style. However, in 1.3, Localizer now caches the lookups but doesn't respect the style when creating the cache key (though it does append the locale to the end of the cache key).

      The side-effects of this are that whatever style is in use when a property is first looked up, that property value will be returned for all subsequent lookups regardless of style.

        Activity

        Hide
        Igor Vaynberg added a comment -

        i commented out the localizer line for now, and added a todo for 1.4

        Show
        Igor Vaynberg added a comment - i commented out the localizer line for now, and added a todo for 1.4
        Hide
        Meetesh Karia added a comment -

        that's good to know. thanks for the information and we'll keep that in mind for migration.

        Show
        Meetesh Karia added a comment - that's good to know. thanks for the information and we'll keep that in mind for migration.
        Hide
        Igor Vaynberg added a comment -

        for now it does, but in 1.4 it will be split out. we meant to do it in 1.3 but forgot.

        Show
        Igor Vaynberg added a comment - for now it does, but in 1.4 it will be split out. we meant to do it in 1.3 but forgot.
        Hide
        Meetesh Karia added a comment -

        Hi Igor,

        You obviously know the code much better than I do, so please forgive me if this is not correct. But, it appears as though the variation is always returned along with the style in Component.getStyle() and that's a final method so no one can change it. In that case, including the variation explicitly in the cache key would be unnecessary, right?

        Thanks,
        Meetesh

        Show
        Meetesh Karia added a comment - Hi Igor, You obviously know the code much better than I do, so please forgive me if this is not correct. But, it appears as though the variation is always returned along with the style in Component.getStyle() and that's a final method so no one can change it. In that case, including the variation explicitly in the cache key would be unnecessary, right? Thanks, Meetesh

          People

          • Assignee:
            Igor Vaynberg
            Reporter:
            Meetesh Karia
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development