File tree Expand file tree Collapse file tree
spring-test/src/main/java/org/springframework/mock/web
spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6666
6767import org .springframework .http .HttpHeaders ;
6868import org .springframework .http .MediaType ;
69+ import org .springframework .lang .Contract ;
6970import org .springframework .util .Assert ;
7071import org .springframework .util .LinkedCaseInsensitiveMap ;
7172import org .springframework .util .LinkedMultiValueMap ;
@@ -1311,6 +1312,7 @@ public void setSession(HttpSession session) {
13111312 }
13121313
13131314 @ Override
1315+ @ Contract ("true -> !null" )
13141316 public @ Nullable HttpSession getSession (boolean create ) {
13151317 checkActive ();
13161318 // Reset session if invalidated.
@@ -1325,7 +1327,7 @@ public void setSession(HttpSession session) {
13251327 }
13261328
13271329 @ Override
1328- public @ Nullable HttpSession getSession () {
1330+ public HttpSession getSession () {
13291331 return getSession (true );
13301332 }
13311333
Original file line number Diff line number Diff line change 6666
6767import org .springframework .http .HttpHeaders ;
6868import org .springframework .http .MediaType ;
69+ import org .springframework .lang .Contract ;
6970import org .springframework .util .Assert ;
7071import org .springframework .util .LinkedCaseInsensitiveMap ;
7172import org .springframework .util .LinkedMultiValueMap ;
@@ -1311,6 +1312,7 @@ public void setSession(HttpSession session) {
13111312 }
13121313
13131314 @ Override
1315+ @ Contract ("true -> !null" )
13141316 public @ Nullable HttpSession getSession (boolean create ) {
13151317 checkActive ();
13161318 // Reset session if invalidated.
@@ -1325,7 +1327,7 @@ public void setSession(HttpSession session) {
13251327 }
13261328
13271329 @ Override
1328- public @ Nullable HttpSession getSession () {
1330+ public HttpSession getSession () {
13291331 return getSession (true );
13301332 }
13311333
You can’t perform that action at this time.
0 commit comments