Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-9686

MockHttpSession does not implement invalidate() properly

    Details

    • Last commented by a User:
      true

      Description

      Status Quo

      The invalidate() method in MockHttpSession is implemented incorrectly, according to the contract of the method:

      Throws: java.lang.IllegalStateException if this method is called on an already invalidated session

      However, invoking invalidate() on the same MockHttpSession instance twice does not do this.

      Proposal

      This can be fixed easily by including a check on the invalid field, and throwing an IllegalStateException if it is true before setting it to true for the first time.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sbrannen Sam Brannen
                Reporter:
                carlholmes Carl Holmes
                Last updater:
                Spring Issuemaster
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  47 weeks ago

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 0.5h
                  0.5h