You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Richard Emberson (JIRA)" <ji...@apache.org> on 2011/02/07 19:24:59 UTC

[jira] Created: (WICKET-3431) org/apache/wicket/util/tester/BaseWicketTester.java add cookie twice

 org/apache/wicket/util/tester/BaseWicketTester.java add cookie twice
---------------------------------------------------------------------

                 Key: WICKET-3431
                 URL: https://issues.apache.org/jira/browse/WICKET-3431
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.5-RC1
         Environment: all
            Reporter: Richard Emberson
            Priority: Trivial


Consider the clearCookie method.
The WicketTesterServletWebResponse clearCookie calls the
super class (ServletWebResponse) clearCookie method which
(amoung other things) calls the addCookie method.
Because of polymorphism, this calls the WicketTesterServletWebResponse
addCookie which adds the cookie to the cookies List.
Then the WicketTesterServletWebResponse clearCookie
method adds the cookie a second time to the cookies List.

Unless it is useful to have the same cookie in the List
more than once, the List could be a Set.

private static class WicketTesterServletWebResponse
  extends ServletWebResponse
  mplements IMetaDataBufferingWebResponse {
...
  @Override
  public void addCookie(Cookie cookie) {
    super.addCookie(cookie);
    cookies.add(cookie);
  }                         
  @Override                     
  public void clearCookie(Cookie cookie) {
    super.clearCookie(cookie);  
    cookies.add(cookie);        
  }                             
...
}
public class ServletWebResponse extends WebResponse {
...
  @Override
  public void addCookie(Cookie cookie) {
    httpServletResponse.addCookie(cookie);
  }

  @Override
  public void clearCookie(Cookie cookie) {
    cookie.setMaxAge(0);
    cookie.setValue(null);
    addCookie(cookie);
  }
...
}


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

        

[jira] Assigned: (WICKET-3431) org/apache/wicket/util/tester/BaseWicketTester.java add cookie twice

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3431?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov reassigned WICKET-3431:
---------------------------------------

    Assignee: Martin Grigorov

>  org/apache/wicket/util/tester/BaseWicketTester.java add cookie twice
> ---------------------------------------------------------------------
>
>                 Key: WICKET-3431
>                 URL: https://issues.apache.org/jira/browse/WICKET-3431
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5-RC1
>         Environment: all
>            Reporter: Richard Emberson
>            Assignee: Martin Grigorov
>            Priority: Trivial
>
> Consider the clearCookie method.
> The WicketTesterServletWebResponse clearCookie calls the
> super class (ServletWebResponse) clearCookie method which
> (amoung other things) calls the addCookie method.
> Because of polymorphism, this calls the WicketTesterServletWebResponse
> addCookie which adds the cookie to the cookies List.
> Then the WicketTesterServletWebResponse clearCookie
> method adds the cookie a second time to the cookies List.
> Unless it is useful to have the same cookie in the List
> more than once, the List could be a Set.
> private static class WicketTesterServletWebResponse
>   extends ServletWebResponse
>   mplements IMetaDataBufferingWebResponse {
> ...
>   @Override
>   public void addCookie(Cookie cookie) {
>     super.addCookie(cookie);
>     cookies.add(cookie);
>   }                         
>   @Override                     
>   public void clearCookie(Cookie cookie) {
>     super.clearCookie(cookie);  
>     cookies.add(cookie);        
>   }                             
> ...
> }
> public class ServletWebResponse extends WebResponse {
> ...
>   @Override
>   public void addCookie(Cookie cookie) {
>     httpServletResponse.addCookie(cookie);
>   }
>   @Override
>   public void clearCookie(Cookie cookie) {
>     cookie.setMaxAge(0);
>     cookie.setValue(null);
>     addCookie(cookie);
>   }
> ...
> }

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

        

[jira] Resolved: (WICKET-3431) org/apache/wicket/util/tester/BaseWicketTester.java add cookie twice

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3431?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-3431.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5-RC2

Fixed with r1069854.

>  org/apache/wicket/util/tester/BaseWicketTester.java add cookie twice
> ---------------------------------------------------------------------
>
>                 Key: WICKET-3431
>                 URL: https://issues.apache.org/jira/browse/WICKET-3431
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5-RC1
>         Environment: all
>            Reporter: Richard Emberson
>            Assignee: Martin Grigorov
>            Priority: Trivial
>             Fix For: 1.5-RC2
>
>
> Consider the clearCookie method.
> The WicketTesterServletWebResponse clearCookie calls the
> super class (ServletWebResponse) clearCookie method which
> (amoung other things) calls the addCookie method.
> Because of polymorphism, this calls the WicketTesterServletWebResponse
> addCookie which adds the cookie to the cookies List.
> Then the WicketTesterServletWebResponse clearCookie
> method adds the cookie a second time to the cookies List.
> Unless it is useful to have the same cookie in the List
> more than once, the List could be a Set.
> private static class WicketTesterServletWebResponse
>   extends ServletWebResponse
>   mplements IMetaDataBufferingWebResponse {
> ...
>   @Override
>   public void addCookie(Cookie cookie) {
>     super.addCookie(cookie);
>     cookies.add(cookie);
>   }                         
>   @Override                     
>   public void clearCookie(Cookie cookie) {
>     super.clearCookie(cookie);  
>     cookies.add(cookie);        
>   }                             
> ...
> }
> public class ServletWebResponse extends WebResponse {
> ...
>   @Override
>   public void addCookie(Cookie cookie) {
>     httpServletResponse.addCookie(cookie);
>   }
>   @Override
>   public void clearCookie(Cookie cookie) {
>     cookie.setMaxAge(0);
>     cookie.setValue(null);
>     addCookie(cookie);
>   }
> ...
> }

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