Replace explicit type arguments with diamond operator

This commit is contained in:
Vedran Pavic
2017-03-04 08:12:11 +01:00
committed by Rob Winch
parent 78ea101a43
commit 5b4d0c40d8
36 changed files with 91 additions and 94 deletions

View File

@@ -49,7 +49,7 @@ public class HomePage {
public HomePage(WebDriver driver) {
this.driver = driver;
this.attributes = new ArrayList<Attribute>();
this.attributes = new ArrayList<>();
}
private static void get(WebDriver driver, String get) {
@@ -80,7 +80,7 @@ public class HomePage {
}
public List<Attribute> attributes() {
List<Attribute> rows = new ArrayList<Attribute>();
List<Attribute> rows = new ArrayList<>();
for (WebElement tr : this.trs) {
rows.add(new Attribute(tr));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 the original author or authors.
* Copyright 2014-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,13 +38,13 @@ public class WebSocketHandlersConfig<S extends ExpiringSession> {
public WebSocketConnectHandler<S> webSocketConnectHandler(
SimpMessageSendingOperations messagingTemplate,
ActiveWebSocketUserRepository repository) {
return new WebSocketConnectHandler<S>(messagingTemplate, repository);
return new WebSocketConnectHandler<>(messagingTemplate, repository);
}
@Bean
public WebSocketDisconnectHandler<S> webSocketDisconnectHandler(
SimpMessageSendingOperations messagingTemplate,
ActiveWebSocketUserRepository repository) {
return new WebSocketDisconnectHandler<S>(messagingTemplate, repository);
return new WebSocketDisconnectHandler<>(messagingTemplate, repository);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 the original author or authors.
* Copyright 2014-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -56,7 +56,7 @@ public class ApplicationTests {
@Test
public void run() throws Exception {
List<Transport> transports = new ArrayList<Transport>(2);
List<Transport> transports = new ArrayList<>(2);
transports.add(new WebSocketTransport(new StandardWebSocketClient()));
transports.add(new RestTemplateXhrTransport());

View File

@@ -46,7 +46,7 @@ public class HomePage {
public HomePage(WebDriver driver) {
this.driver = driver;
this.attributes = new ArrayList<Attribute>();
this.attributes = new ArrayList<>();
}
private static void get(WebDriver driver, String get) {
@@ -64,7 +64,7 @@ public class HomePage {
}
public List<Attribute> attributes() {
List<Attribute> rows = new ArrayList<Attribute>();
List<Attribute> rows = new ArrayList<>();
for (WebElement tr : this.trs) {
rows.add(new Attribute(tr));
}

View File

@@ -46,7 +46,7 @@ public class HomePage {
public HomePage(WebDriver driver) {
this.driver = driver;
this.attributes = new ArrayList<Attribute>();
this.attributes = new ArrayList<>();
}
private static void get(WebDriver driver, String get) {
@@ -64,7 +64,7 @@ public class HomePage {
}
public List<Attribute> attributes() {
List<Attribute> rows = new ArrayList<Attribute>();
List<Attribute> rows = new ArrayList<>();
for (WebElement tr : this.trs) {
rows.add(new Attribute(tr));
}

View File

@@ -46,7 +46,7 @@ public class HomePage {
public HomePage(WebDriver driver) {
this.driver = driver;
this.attributes = new ArrayList<Attribute>();
this.attributes = new ArrayList<>();
}
private static void get(WebDriver driver, String get) {
@@ -64,7 +64,7 @@ public class HomePage {
}
public List<Attribute> attributes() {
List<Attribute> rows = new ArrayList<Attribute>();
List<Attribute> rows = new ArrayList<>();
for (WebElement tr : this.trs) {
rows.add(new Attribute(tr));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 the original author or authors.
* Copyright 2014-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@ public class RestDemoController {
@RequestMapping(value = "/", produces = "application/json")
public Map<String, String> helloUser(Principal principal) {
HashMap<String, String> result = new HashMap<String, String>();
HashMap<String, String> result = new HashMap<>();
result.put("username", principal.getName());
return result;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 the original author or authors.
* Copyright 2014-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -55,7 +55,7 @@ public class UserAccountsFilter implements Filter {
String unauthenticatedAlias = null;
String contextPath = httpRequest.getContextPath();
List<Account> accounts = new ArrayList<Account>();
List<Account> accounts = new ArrayList<>();
Account currentAccount = null;
for (Map.Entry<String, String> entry : sessionIds.entrySet()) {
String alias = entry.getKey();

View File

@@ -46,7 +46,7 @@ public class HomePage {
public HomePage(WebDriver driver) {
this.driver = driver;
this.attributes = new ArrayList<Attribute>();
this.attributes = new ArrayList<>();
}
private static void get(WebDriver driver, String get) {
@@ -64,7 +64,7 @@ public class HomePage {
}
public List<Attribute> attributes() {
List<Attribute> rows = new ArrayList<Attribute>();
List<Attribute> rows = new ArrayList<>();
for (WebElement tr : this.trs) {
rows.add(new Attribute(tr));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 the original author or authors.
* Copyright 2014-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -66,7 +66,7 @@ public class Initializer implements ServletContextListener {
SessionRepository<ExpiringSession> sessionRepository = new MapSessionRepository(
sessions);
SessionRepositoryFilter<ExpiringSession> filter = new SessionRepositoryFilter<ExpiringSession>(
SessionRepositoryFilter<ExpiringSession> filter = new SessionRepositoryFilter<>(
sessionRepository);
Dynamic fr = sc.addFilter("springSessionFilter", filter);
fr.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), true, "/*");

View File

@@ -46,7 +46,7 @@ public class HomePage {
public HomePage(WebDriver driver) {
this.driver = driver;
this.attributes = new ArrayList<Attribute>();
this.attributes = new ArrayList<>();
}
private static void get(WebDriver driver, String get) {
@@ -64,7 +64,7 @@ public class HomePage {
}
public List<Attribute> attributes() {
List<Attribute> rows = new ArrayList<Attribute>();
List<Attribute> rows = new ArrayList<>();
for (WebElement tr : this.trs) {
rows.add(new Attribute(tr));
}

View File

@@ -46,7 +46,7 @@ public class HomePage {
public HomePage(WebDriver driver) {
this.driver = driver;
this.attributes = new ArrayList<Attribute>();
this.attributes = new ArrayList<>();
}
private static void get(WebDriver driver, String get) {
@@ -64,7 +64,7 @@ public class HomePage {
}
public List<Attribute> attributes() {
List<Attribute> rows = new ArrayList<Attribute>();
List<Attribute> rows = new ArrayList<>();
for (WebElement tr : this.trs) {
rows.add(new Attribute(tr));
}