Make classes final where possible

Update classes that have private constructors so that they are also
declared final. In a few cases, inner-classes used private constructors
but were subclassed. These have now been changed to have package-private
constructors.

Issue gh-8945
This commit is contained in:
Phillip Webb
2020-07-24 19:03:31 -07:00
committed by Rob Winch
parent b5d499e2eb
commit 6894ff5d12
58 changed files with 229 additions and 226 deletions

View File

@@ -34,6 +34,9 @@ public class AuthenticatedReactiveAuthorizationManager<T> implements ReactiveAut
private AuthenticationTrustResolver authTrustResolver = new AuthenticationTrustResolverImpl();
AuthenticatedReactiveAuthorizationManager() {
}
@Override
public Mono<AuthorizationDecision> check(Mono<Authentication> authentication, T object) {
return authentication.filter(this::isNotAnonymous).map(a -> new AuthorizationDecision(a.isAuthenticated()))
@@ -59,7 +62,4 @@ public class AuthenticatedReactiveAuthorizationManager<T> implements ReactiveAut
return new AuthenticatedReactiveAuthorizationManager<>();
}
private AuthenticatedReactiveAuthorizationManager() {
}
}

View File

@@ -36,7 +36,7 @@ public class AuthorityReactiveAuthorizationManager<T> implements ReactiveAuthori
private final List<String> authorities;
private AuthorityReactiveAuthorizationManager(String... authorities) {
AuthorityReactiveAuthorizationManager(String... authorities) {
this.authorities = Arrays.asList(authorities);
}

View File

@@ -334,7 +334,7 @@ public class User implements UserDetails, CredentialsContainer {
* Builds the user to be added. At minimum the username, password, and authorities
* should provided. The remaining attributes have reasonable defaults.
*/
public static class UserBuilder {
public static final class UserBuilder {
private String username;

View File

@@ -26,7 +26,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
*
* @author Ben Alex
*/
public class PopulatedDatabase {
public final class PopulatedDatabase {
private static TestDataSource dataSource = null;