Cleanup redundant type casts
This commit is contained in:
+1
-1
@@ -58,7 +58,7 @@ public class AnonymousAuthenticationTokenTests {
|
||||
|
||||
try {
|
||||
new AnonymousAuthenticationToken("key", "Test",
|
||||
(List<GrantedAuthority>) null);
|
||||
null);
|
||||
fail("Should have thrown IllegalArgumentException");
|
||||
}
|
||||
catch (IllegalArgumentException expected) {
|
||||
|
||||
+1
-2
@@ -21,7 +21,6 @@ package org.springframework.security.authentication.dao;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.security.core.userdetails.User;
|
||||
import org.springframework.security.core.userdetails.UserCache;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
@@ -29,7 +28,7 @@ public class MockUserCache implements UserCache {
|
||||
private Map<String, UserDetails> cache = new HashMap<>();
|
||||
|
||||
public UserDetails getUserFromCache(String username) {
|
||||
return (User) cache.get(username);
|
||||
return cache.get(username);
|
||||
}
|
||||
|
||||
public void putUserInCache(UserDetails user) {
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ public abstract class AbstractDelegatingSecurityContextScheduledExecutorServiceT
|
||||
@Test
|
||||
public void scheduleCallable() {
|
||||
when(
|
||||
(ScheduledFuture<Object>) delegate.schedule(wrappedCallable, 1,
|
||||
delegate.schedule(wrappedCallable, 1,
|
||||
TimeUnit.SECONDS)).thenReturn(expectedResult);
|
||||
ScheduledFuture<Object> result = executor.schedule(callable, 1, TimeUnit.SECONDS);
|
||||
assertThat(result).isEqualTo(expectedResult);
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ public class KeyBasedPersistenceTokenServiceTests {
|
||||
service.setServerSecret("MY:SECRET$$$#");
|
||||
service.setServerInteger(Integer.valueOf(454545));
|
||||
try {
|
||||
SecureRandom rnd = (SecureRandom) fb.getObject();
|
||||
SecureRandom rnd = fb.getObject();
|
||||
service.setSecureRandom(rnd);
|
||||
service.afterPropertiesSet();
|
||||
}
|
||||
|
||||
+1
-1
@@ -406,7 +406,7 @@ public class JdbcUserDetailsManagerTests {
|
||||
private Map<String, UserDetails> cache = new HashMap<>();
|
||||
|
||||
public UserDetails getUserFromCache(String username) {
|
||||
return (User) cache.get(username);
|
||||
return cache.get(username);
|
||||
}
|
||||
|
||||
public void putUserInCache(UserDetails user) {
|
||||
|
||||
Reference in New Issue
Block a user