Tapestry 5
  1. Tapestry 5
  2. TAP5-1585

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.3, 5.2
    • Fix Version/s: 5.3
    • Component/s: tapestry-core
    • Labels:

      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').

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        1m 27s 1 Howard M. Lewis Ship 24/Jul/11 03:33
        In Progress In Progress Closed Closed
        23m 41s 1 Howard M. Lewis Ship 24/Jul/11 03:57
        Hide
        Hudson added a comment -

        Integrated in tapestry-trunk-freestyle #431 (See https://builds.apache.org/job/tapestry-trunk-freestyle/431/)
        TAP5-1585: @InjectPage annotation can leak page instances from one locale to another

        hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1150276
        Files :

        • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/InjectPageWorker.java
        Show
        Hudson added a comment - Integrated in tapestry-trunk-freestyle #431 (See https://builds.apache.org/job/tapestry-trunk-freestyle/431/ ) TAP5-1585 : @InjectPage annotation can leak page instances from one locale to another hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1150276 Files : /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/InjectPageWorker.java
        Howard M. Lewis Ship made changes -
        Status In Progress [ 3 ] Closed [ 6 ]
        Fix Version/s 5.3 [ 12316024 ]
        Resolution Fixed [ 1 ]
        Howard M. Lewis Ship made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Howard M. Lewis Ship made changes -
        Field Original Value New Value
        Assignee Howard M. Lewis Ship [ hlship ]
        Howard M. Lewis Ship created issue -

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Howard M. Lewis Ship
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development