Use diamond type

This commit is contained in:
Johnny Lim
2017-11-20 02:25:30 +09:00
committed by Rob Winch
parent cfe40358bd
commit 57353d18e5
221 changed files with 423 additions and 428 deletions

View File

@@ -24,8 +24,8 @@ import java.util.*;
* @author Luke Taylor
*/
public class BeanNameCollectingPostProcessor implements BeanPostProcessor {
Set<String> beforeInitPostProcessedBeans = new HashSet<String>();
Set<String> afterInitPostProcessedBeans = new HashSet<String>();
Set<String> beforeInitPostProcessedBeans = new HashSet<>();
Set<String> afterInitPostProcessedBeans = new HashSet<>();
public Object postProcessBeforeInitialization(Object bean, String beanName)
throws BeansException {

View File

@@ -30,10 +30,10 @@ import org.springframework.security.authentication.event.AbstractAuthenticationF
* @since 3.1
*/
public class CollectingAppListener implements ApplicationListener {
Set<ApplicationEvent> events = new HashSet<ApplicationEvent>();
Set<AbstractAuthenticationEvent> authenticationEvents = new HashSet<AbstractAuthenticationEvent>();
Set<AbstractAuthenticationFailureEvent> authenticationFailureEvents = new HashSet<AbstractAuthenticationFailureEvent>();
Set<AbstractAuthorizationEvent> authorizationEvents = new HashSet<AbstractAuthorizationEvent>();
Set<ApplicationEvent> events = new HashSet<>();
Set<AbstractAuthenticationEvent> authenticationEvents = new HashSet<>();
Set<AbstractAuthenticationFailureEvent> authenticationFailureEvents = new HashSet<>();
Set<AbstractAuthorizationEvent> authorizationEvents = new HashSet<>();
public void onApplicationEvent(ApplicationEvent event) {
if (event instanceof AbstractAuthenticationEvent) {

View File

@@ -24,7 +24,7 @@ import java.util.List;
*/
class ConcereteSecurityConfigurerAdapter extends
SecurityConfigurerAdapter<Object, SecurityBuilder<Object>> {
private List<Object> list = new ArrayList<Object>();
private List<Object> list = new ArrayList<>();
@Override
public void configure(SecurityBuilder<Object> builder) throws Exception {

View File

@@ -30,7 +30,7 @@ public class LdapAuthenticationProviderConfigurerTest {
@Before
public void setUp() {
configurer = new LdapAuthenticationProviderConfigurer<AuthenticationManagerBuilder>();
configurer = new LdapAuthenticationProviderConfigurer<>();
}
// SEC-2557

View File

@@ -107,14 +107,14 @@ public class AbstractSecurityWebSocketMessageBrokerConfigurerDocTests {
private Message<String> message(SimpMessageHeaderAccessor headers, String destination) {
headers.setSessionId("123");
headers.setSessionAttributes(new HashMap<String, Object>());
headers.setSessionAttributes(new HashMap<>());
if (destination != null) {
headers.setDestination(destination);
}
if (messageUser != null) {
headers.setUser(messageUser);
}
return new GenericMessage<String>("hi", headers.getMessageHeaders());
return new GenericMessage<>("hi", headers.getMessageHeaders());
}
@Controller

View File

@@ -511,14 +511,14 @@ public class AbstractSecurityWebSocketMessageBrokerConfigurerTests {
private Message<String> message(SimpMessageHeaderAccessor headers, String destination) {
headers.setSessionId("123");
headers.setSessionAttributes(new HashMap<String, Object>());
headers.setSessionAttributes(new HashMap<>());
if (destination != null) {
headers.setDestination(destination);
}
if (messageUser != null) {
headers.setUser(messageUser);
}
return new GenericMessage<String>("hi", headers.getMessageHeaders());
return new GenericMessage<>("hi", headers.getMessageHeaders());
}
private MessageChannel clientInboundChannel() {

View File

@@ -114,7 +114,7 @@ public class AuthenticationManagerBeanDefinitionParserTests {
private static class AuthListener implements
ApplicationListener<AbstractAuthenticationEvent> {
List<AbstractAuthenticationEvent> events = new ArrayList<AbstractAuthenticationEvent>();
List<AbstractAuthenticationEvent> events = new ArrayList<>();
public void onApplicationEvent(AbstractAuthenticationEvent event) {
this.events.add(event);

View File

@@ -287,7 +287,7 @@ public class GlobalMethodSecurityBeanDefinitionParserTests {
+ AUTH_PROVIDER_XML);
SecurityContextHolder.getContext().setAuthentication(bob);
target = (BusinessService) appContext.getBean("target");
List<String> arg = new ArrayList<String>();
List<String> arg = new ArrayList<>();
arg.add("joe");
arg.add("bob");
arg.add("sam");