Make assertion messages in CookieCsrfTokenRepository clearer
Changes assertion message format from 'X is not null' to
'X cannot be null' since this is more meaningful when the error
occurs and the message is printed in the logs.
Closes gh-9195
@ -100,7 +100,7 @@ public final class CookieCsrfTokenRepository implements CsrfTokenRepository {
@@ -100,7 +100,7 @@ public final class CookieCsrfTokenRepository implements CsrfTokenRepository {
*provideatoken
*/
publicvoidsetParameterName(StringparameterName){
Assert.notNull(parameterName,"parameterName is not null");
Assert.notNull(parameterName,"parameterName cannot be null");
this.parameterName=parameterName;
}
@ -110,7 +110,7 @@ public final class CookieCsrfTokenRepository implements CsrfTokenRepository {
@@ -110,7 +110,7 @@ public final class CookieCsrfTokenRepository implements CsrfTokenRepository {
*token
*/
publicvoidsetHeaderName(StringheaderName){
Assert.notNull(headerName,"headerName is not null");
Assert.notNull(headerName,"headerName cannot be null");
this.headerName=headerName;
}
@ -120,7 +120,7 @@ public final class CookieCsrfTokenRepository implements CsrfTokenRepository {
@@ -120,7 +120,7 @@ public final class CookieCsrfTokenRepository implements CsrfTokenRepository {
*andreadfrom
*/
publicvoidsetCookieName(StringcookieName){
Assert.notNull(cookieName,"cookieName is not null");
Assert.notNull(cookieName,"cookieName cannot be null");
this.cookieName=cookieName;
}
@ -216,7 +216,7 @@ public final class CookieCsrfTokenRepository implements CsrfTokenRepository {
@@ -216,7 +216,7 @@ public final class CookieCsrfTokenRepository implements CsrfTokenRepository {
*@since5.5
*/
publicvoidsetCookieMaxAge(intcookieMaxAge){
Assert.isTrue(cookieMaxAge!=0,"cookieMaxAge is not zero");
Assert.isTrue(cookieMaxAge!=0,"cookieMaxAge cannot be zero");