[ 
https://issues.apache.org/jira/browse/WICKET-3994?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniele Cremonini updated WICKET-3994:
--------------------------------------

    Attachment: fix-WICKET-3994.patch

I attach the patch

> MockWebApplication double invocation of cycle.detach()
> ------------------------------------------------------
>
>                 Key: WICKET-3994
>                 URL: https://issues.apache.org/jira/browse/WICKET-3994
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.16, 1.4.17, 1.4.18
>            Reporter: Daniele Cremonini
>            Priority: Minor
>         Attachments: fix-WICKET-3994.patch
>
>
> 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);
>       }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to