1
0
mirror of synced 2026-08-04 17:27:13 +00:00

Cleanup redundant type casts

This commit is contained in:
Lars Grefer
2019-07-04 19:04:19 +02:00
committed by Rob Winch
parent 43737a56bd
commit c5b5cc507c
31 changed files with 38 additions and 42 deletions
@@ -58,7 +58,7 @@ public class AnonymousAuthenticationTokenTests {
try {
new AnonymousAuthenticationToken("key", "Test",
(List<GrantedAuthority>) null);
null);
fail("Should have thrown IllegalArgumentException");
}
catch (IllegalArgumentException expected) {
@@ -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) {
@@ -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);
@@ -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();
}
@@ -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) {