Fix class and variable names

This commit is contained in:
Ruslan Stelmachenko 2019-11-21 22:52:55 +02:00 committed by Eleftheria Stein-Kousathana
parent 8ebc7ca0ea
commit c38e57fa42
2 changed files with 10 additions and 11 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -19,7 +19,6 @@ import org.springframework.context.ApplicationContext;
import org.springframework.core.annotation.Order;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.crypto.password.PasswordEncoder;
/**
* Lazily initializes the global authentication with an {@link AuthenticationProvider} if it is
@ -47,10 +46,10 @@ class InitializeAuthenticationProviderBeanManagerConfigurer
@Override
public void init(AuthenticationManagerBuilder auth) throws Exception {
auth.apply(new InitializeUserDetailsManagerConfigurer());
auth.apply(new InitializeAuthenticationProviderManagerConfigurer());
}
class InitializeUserDetailsManagerConfigurer
class InitializeAuthenticationProviderManagerConfigurer
extends GlobalAuthenticationConfigurerAdapter {
@Override
public void configure(AuthenticationManagerBuilder auth) {
@ -68,17 +67,17 @@ class InitializeAuthenticationProviderBeanManagerConfigurer
}
/**
* @return
* @return a bean of the requested class if there's just a single registered component, null otherwise.
*/
private <T> T getBeanOrNull(Class<T> type) {
String[] userDetailsBeanNames = InitializeAuthenticationProviderBeanManagerConfigurer.this.context
String[] beanNames = InitializeAuthenticationProviderBeanManagerConfigurer.this.context
.getBeanNamesForType(type);
if (userDetailsBeanNames.length != 1) {
if (beanNames.length != 1) {
return null;
}
return InitializeAuthenticationProviderBeanManagerConfigurer.this.context
.getBean(userDetailsBeanNames[0], type);
.getBean(beanNames[0], type);
}
}
}

View File

@ -85,14 +85,14 @@ class InitializeUserDetailsBeanManagerConfigurer
* @return a bean of the requested class if there's just a single registered component, null otherwise.
*/
private <T> T getBeanOrNull(Class<T> type) {
String[] userDetailsBeanNames = InitializeUserDetailsBeanManagerConfigurer.this.context
String[] beanNames = InitializeUserDetailsBeanManagerConfigurer.this.context
.getBeanNamesForType(type);
if (userDetailsBeanNames.length != 1) {
if (beanNames.length != 1) {
return null;
}
return InitializeUserDetailsBeanManagerConfigurer.this.context
.getBean(userDetailsBeanNames[0], type);
.getBean(beanNames[0], type);
}
}
}