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

@@ -104,7 +104,7 @@ public class DefaultSpringSecurityContextSourceTests extends AbstractLdapIntegra
@Test(expected = IllegalArgumentException.class)
public void instantiationFailsWithEmptyServerList() throws Exception {
List<String> serverUrls = new ArrayList<String>();
List<String> serverUrls = new ArrayList<>();
DefaultSpringSecurityContextSource ctxSrc = new DefaultSpringSecurityContextSource(
serverUrls, "dc=springframework,dc=org");
ctxSrc.afterPropertiesSet();
@@ -112,7 +112,7 @@ public class DefaultSpringSecurityContextSourceTests extends AbstractLdapIntegra
@Test
public void instantiationSuceedsWithProperServerList() throws Exception {
List<String> serverUrls = new ArrayList<String>();
List<String> serverUrls = new ArrayList<>();
serverUrls.add("ldap://foo:789");
serverUrls.add("ldap://bar:389");
serverUrls.add("ldaps://blah:636");
@@ -127,7 +127,7 @@ public class DefaultSpringSecurityContextSourceTests extends AbstractLdapIntegra
@Test
public void instantiationSuceedsWithEmtpyBaseDn() throws Exception {
String baseDn = "";
List<String> serverUrls = new ArrayList<String>();
List<String> serverUrls = new ArrayList<>();
serverUrls.add("ldap://foo:789");
serverUrls.add("ldap://bar:389");
serverUrls.add("ldaps://blah:636");
@@ -140,7 +140,7 @@ public class DefaultSpringSecurityContextSourceTests extends AbstractLdapIntegra
@Test(expected = IllegalArgumentException.class)
public void instantiationFailsWithIncorrectServerUrl() throws Exception {
List<String> serverUrls = new ArrayList<String>();
List<String> serverUrls = new ArrayList<>();
// a simple trailing slash should be ok
serverUrls.add("ldaps://blah:636/");
// this url should be rejected because the root DN goes into a separate parameter

View File

@@ -185,7 +185,7 @@ public class SpringSecurityLdapTemplateITests extends AbstractLdapIntegrationTes
@Test
public void nonSpringLdapSearchCodeTestMethod() throws Exception {
java.util.Hashtable<String, String> env = new java.util.Hashtable<String, String>();
java.util.Hashtable<String, String> env = new java.util.Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://localhost:"
+ ApacheDSServerIntegrationTests.getServerPort());

View File

@@ -114,7 +114,7 @@ public class BindAuthenticatorTests extends AbstractLdapIntegrationTests {
/*
* @Test public void messingWithEscapedChars() throws Exception {
* Hashtable<String,String> env = new Hashtable<String,String>();
* Hashtable<String,String> env = new Hashtable<>();
* env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
* env.put(Context.PROVIDER_URL, "ldap://127.0.0.1:22389/dc=springsource,dc=com");
* env.put(Context.SECURITY_AUTHENTICATION, "simple");

View File

@@ -196,8 +196,8 @@ public class ApacheDSContainerTests {
}
private List<Integer> getDefaultPorts(int count) throws IOException {
List<ServerSocket> connections = new ArrayList<ServerSocket>();
List<Integer> availablePorts = new ArrayList<Integer>(count);
List<ServerSocket> connections = new ArrayList<>();
List<Integer> availablePorts = new ArrayList<>(count);
try {
for (int i = 0; i < count; i++) {
ServerSocket socket = new ServerSocket(0);

View File

@@ -46,8 +46,8 @@ public class UnboundIdContainerTests {
}
private List<Integer> getDefaultPorts(int count) throws IOException {
List<ServerSocket> connections = new ArrayList<ServerSocket>();
List<Integer> availablePorts = new ArrayList<Integer>(count);
List<ServerSocket> connections = new ArrayList<>();
List<Integer> availablePorts = new ArrayList<>(count);
try {
for (int i = 0; i < count; i++) {
ServerSocket socket = new ServerSocket(0);

View File

@@ -147,7 +147,7 @@ public class DefaultLdapAuthoritiesPopulatorTests extends AbstractLdapIntegratio
@Override
protected Set<GrantedAuthority> getAdditionalRoles(DirContextOperations user,
String username) {
return new HashSet<GrantedAuthority>(
return new HashSet<>(
AuthorityUtils.createAuthorityList("ROLE_EXTRA"));
}
};