Quantcast

Error in CookieValuePersister#save(String, String)?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Error in CookieValuePersister#save(String, String)?

Gabriel Landon
Here's the code of the save function :

        /**
         * @see org.apache.wicket.markup.html.form.persistence.IValuePersister#save(String, String)
         */
        public void save(String key, final String value)
        {
                key = getSaveKey(key);
                Cookie cookie = getCookie(key);
                if (cookie == null)
                {
                        cookie = new Cookie(key, value == null ? "" : value);
                }
                else
                {
                        cookie.setValue(key == null ? "" : value);
                }
                cookie.setSecure(false);
                cookie.setMaxAge(settings.getMaxAge());

                save(cookie);
        }


Shouldn't the line :
cookie.setValue(key == null ? "" : value);
be of course :
cookie.setValue(value == null ? "" : value);

Shall I open a jira?

Loading...