Use diamond type
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class LdapAuthenticationProviderConfigurerTest {
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
configurer = new LdapAuthenticationProviderConfigurer<AuthenticationManagerBuilder>();
|
||||
configurer = new LdapAuthenticationProviderConfigurer<>();
|
||||
}
|
||||
|
||||
// SEC-2557
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user