Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3994

MockWebApplication double invocation of cycle.detach()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4.16, 1.4.17, 1.4.18
    • Fix Version/s: 1.4.19
    • Component/s: wicket
    • Labels:
      None

      Description

      Porting JAMon integration to Wicket 1.4 test JamonMonitoredWebRequestCycleTest (a WicketStuff class) fails do I discovered a double invocation that seems a bug. Explanation follows.

      MockWebApplication.processRequestCycle(WebRequestCycle) method calls

      cycle.request();

      then

      cycle.detach();

      but cycle.detach() is also called inside cycle.request() resulting in a double invocation.

      public void processRequestCycle(WebRequestCycle cycle)
      {
      try
      {
      cycle.request();
      if (cycle.wasHandled() == false)

      { cycle.setRequestTarget(new WebErrorCodeResponseTarget( HttpServletResponse.SC_NOT_FOUND)); }

      cycle.detach(); // <== second invocation, I would remove it
      createRequestCycle();
      parametersForNextRequest.clear();
      servletRequest.getParameterMap().clear();
      }
      finally

      { cycle.getResponse().close(); }

      postProcessRequestCycle(cycle);
      }

        Attachments

        1. fix-WICKET-3994.patch
          0.6 kB
          Daniele Cremonini

          Activity

            People

            • Assignee:
              ivaynberg Igor Vaynberg
              Reporter:
              dcremonini Daniele Cremonini
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: