mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-25 13:32:30 +00:00
SEC-393: More elegantly deal with setProviders(List) type safety enforcement.
This commit is contained in:
parent
5e819af782
commit
2984913051
@ -273,17 +273,8 @@ public class ProviderManager extends AbstractAuthenticationManager implements In
|
||||
Iterator iter = newList.iterator();
|
||||
|
||||
while (iter.hasNext()) {
|
||||
Object currentObject = null;
|
||||
|
||||
try {
|
||||
currentObject = iter.next();
|
||||
|
||||
//TODO bad idea, should use assignable from or instance of
|
||||
AuthenticationProvider attemptToCast = (AuthenticationProvider) currentObject;
|
||||
} catch (ClassCastException cce) {
|
||||
throw new IllegalArgumentException("AuthenticationProvider " + currentObject.getClass().getName()
|
||||
+ " must implement AuthenticationProvider");
|
||||
}
|
||||
Object currentObject = iter.next();
|
||||
Assert.isInstanceOf(AuthenticationProvider.class, currentObject, "Can only provide AuthenticationProvider instances");
|
||||
}
|
||||
|
||||
this.providers = newList;
|
||||
|
Loading…
x
Reference in New Issue
Block a user