Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1585

@InjectPage annotation can leak page instances from one locale to another

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.3, 5.2
    • 5.3
    • tapestry-core

    Description

      Noticed this code:

      private final class InjectedPageConduit extends ReadOnlyFieldValueConduit
      {
      private final String injectedPageName;

      private Object page;

      private InjectedPageConduit(ComponentResources resources, String fieldName,
      String injectedPageName)
      {
      super(resources, fieldName);

      this.injectedPageName = injectedPageName;

      resources.addPageLifecycleListener(new PageLifecycleAdapter()
      {
      @Override
      public void containingPageDidDetach()

      { page = null; }

      });
      }

      public Object get(Object instance, InstanceContext context)

      { if (page == null) page = componentSource.getPage(injectedPageName); return page; }

      Basically, what we have here is a field per instance storing the page ... this should go in a PerThreadValue. As currently coded, there will be windows where a page in one locale will have a page in some other locale injected into it since the single field is injected across locale (and, in 5.3, ComponentResourceSelector axis').

      Attachments

        Activity

          People

            hlship Howard Lewis Ship
            hlship Howard Lewis Ship
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: