Преглед на файлове

Use instanceof pattern matching in initAuthFilter

twosom преди 2 години
родител
ревизия
ae23e3f5f4
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      web/src/main/java/org/springframework/security/web/authentication/ui/DefaultLoginPageGeneratingFilter.java

+ 2 - 2
web/src/main/java/org/springframework/security/web/authentication/ui/DefaultLoginPageGeneratingFilter.java

@@ -96,8 +96,8 @@ public class DefaultLoginPageGeneratingFilter extends GenericFilterBean {
 		this.formLoginEnabled = true;
 		this.usernameParameter = authFilter.getUsernameParameter();
 		this.passwordParameter = authFilter.getPasswordParameter();
-		if (authFilter.getRememberMeServices() instanceof AbstractRememberMeServices) {
-			this.rememberMeParameter = ((AbstractRememberMeServices) authFilter.getRememberMeServices()).getParameter();
+		if (authFilter.getRememberMeServices() instanceof AbstractRememberMeServices rememberMeServices) {
+			this.rememberMeParameter = rememberMeServices.getParameter();
 		}
 	}