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

CookieUtils save method: incomplete javadoc

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Won't Fix
    • 8.12.0
    • None
    • wicket-core

    Description

      The java doc of the CookieUtils.save method is 'Create a Cookie with key and value and save it in the browser with the next response' ( https://github.com/apache/wicket/blob/rel/wicket-8.12.0/wicket-core/src/main/java/org/apache/wicket/util/cookies/CookieUtils.java#L147 ).

      But when we look to the source code, it doesn't only create the cookie, it updates the cookie if it exists.
      it may confuse a developer a little bit.

      The javadoc fix could be  'Create a Cookie with key and value or update the Cookie value if the Cookie exists and save it in the browser with the next response'.

      We could rename the method save into createOrUpdate but this would break the backward compatibility.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            tnmtechnologies Michel Trefcon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0.25h
                0.25h
                Remaining:
                Remaining Estimate - 0.25h
                0.25h
                Logged:
                Time Spent - Not Specified
                Not Specified