--- old/test/jdk/com/sun/jndi/dns/CheckAccess.java 2020-03-25 13:45:25.000000000 +0800 +++ new/test/jdk/com/sun/jndi/dns/CheckAccess.java 2020-03-25 13:45:25.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ public class CheckAccess { public static final void main(String[] args) throws Exception { try { - Class clazz = Class.forName("com.sun.jndi.dns.DnsContext"); + Class clazz = Class.forName("com.sun.jndi.dns.DnsContext"); Field field = clazz.getField("debug"); if (Modifier.isPublic(field.getModifiers())) { throw new Exception( --- old/test/jdk/com/sun/jndi/dns/EnvTests/AddInherited.java 2020-03-25 13:45:26.000000000 +0800 +++ new/test/jdk/com/sun/jndi/dns/EnvTests/AddInherited.java 2020-03-25 13:45:26.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,8 +55,8 @@ Context child = (Context) context().lookup(getKey()); - Hashtable envParent = context().getEnvironment(); - Hashtable envChild = child.getEnvironment(); + Hashtable envParent = context().getEnvironment(); + Hashtable envChild = child.getEnvironment(); DNSTestUtils.debug(child); DNSTestUtils.debug("Parent env: " + envParent); --- old/test/jdk/com/sun/jndi/dns/EnvTests/GetEnv.java 2020-03-25 13:45:27.000000000 +0800 +++ new/test/jdk/com/sun/jndi/dns/EnvTests/GetEnv.java 2020-03-25 13:45:27.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,8 +53,8 @@ Context child = (Context) context().lookup(getKey()); - Hashtable envParent = context().getEnvironment(); - Hashtable envChild = child.getEnvironment(); + Hashtable envParent = context().getEnvironment(); + Hashtable envChild = child.getEnvironment(); DNSTestUtils.debug(child); DNSTestUtils.debug("Parent env: " + envParent); --- old/test/jdk/com/sun/jndi/dns/EnvTests/RemoveInherited.java 2020-03-25 13:45:29.000000000 +0800 +++ new/test/jdk/com/sun/jndi/dns/EnvTests/RemoveInherited.java 2020-03-25 13:45:28.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,8 +67,8 @@ Context child = (Context) context().lookup(getKey()); - Hashtable envParent = context().getEnvironment(); - Hashtable envChild = child.getEnvironment(); + Hashtable envParent = context().getEnvironment(); + Hashtable envChild = child.getEnvironment(); DNSTestUtils.debug(child); DNSTestUtils.debug("Parent env: " + envParent); --- old/test/jdk/com/sun/jndi/dns/EnvTests/SubcontextAdd.java 2020-03-25 13:45:30.000000000 +0800 +++ new/test/jdk/com/sun/jndi/dns/EnvTests/SubcontextAdd.java 2020-03-25 13:45:29.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,8 +57,8 @@ addToEnvAndVerifyOldValIsNull(child, "some.irrelevant.property", "somevalue"); - Hashtable envParent = context().getEnvironment(); - Hashtable envChild = child.getEnvironment(); + Hashtable envParent = context().getEnvironment(); + Hashtable envChild = child.getEnvironment(); DNSTestUtils.debug(child); DNSTestUtils.debug("Parent env: " + envParent); --- old/test/jdk/com/sun/jndi/dns/EnvTests/SubcontextRemove.java 2020-03-25 13:45:31.000000000 +0800 +++ new/test/jdk/com/sun/jndi/dns/EnvTests/SubcontextRemove.java 2020-03-25 13:45:31.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,8 +62,8 @@ + val); } - Hashtable envParent = context().getEnvironment(); - Hashtable envChild = child.getEnvironment(); + Hashtable envParent = context().getEnvironment(); + Hashtable envChild = child.getEnvironment(); DNSTestUtils.debug(child); DNSTestUtils.debug("Parent env: " + envParent); --- old/test/jdk/com/sun/jndi/dns/FactoryTests/TestDnsObject.java 2020-03-25 13:45:32.000000000 +0800 +++ new/test/jdk/com/sun/jndi/dns/FactoryTests/TestDnsObject.java 2020-03-25 13:45:32.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,7 @@ public TestDnsObject(Attribute attr) { StringBuilder buf = new StringBuilder(); try { - NamingEnumeration enumObj = attr.getAll(); + NamingEnumeration enumObj = attr.getAll(); while (enumObj.hasMore()) { buf.append(enumObj.next()); } --- old/test/jdk/com/sun/jndi/dns/FedTests/ListFedBase.java 2020-03-25 13:45:33.000000000 +0800 +++ new/test/jdk/com/sun/jndi/dns/FedTests/ListFedBase.java 2020-03-25 13:45:33.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,7 @@ * @param expectedCount given expected count * @throws NamingException */ - public void verifyNamingEnumeration(NamingEnumeration enumObj, + public void verifyNamingEnumeration(NamingEnumeration enumObj, int expectedCount) throws NamingException { DNSTestUtils.debug("Enum is: " + enumObj); --- old/test/jdk/com/sun/jndi/dns/FedTests/ListNns.java 2020-03-25 13:45:34.000000000 +0800 +++ new/test/jdk/com/sun/jndi/dns/FedTests/ListNns.java 2020-03-25 13:45:34.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,7 +52,7 @@ env().put(Context.OBJECT_FACTORIES, "FedObjectFactory"); setContext(new InitialDirContext(env())); - NamingEnumeration enumObj = context().listBindings(getKey() + "/"); + NamingEnumeration enumObj = context().listBindings(getKey() + "/"); verifyNamingEnumeration(enumObj, COUNT_LIMIT); } } --- old/test/jdk/com/sun/jndi/dns/FedTests/ListSubInterior.java 2020-03-25 13:45:35.000000000 +0800 +++ new/test/jdk/com/sun/jndi/dns/FedTests/ListSubInterior.java 2020-03-25 13:45:35.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,7 +54,7 @@ env().put(Context.OBJECT_FACTORIES, "FedObjectFactory"); setContext(new InitialDirContext(env())); - NamingEnumeration enumObj = context().listBindings(getKey() + "/a/b"); + NamingEnumeration enumObj = context().listBindings(getKey() + "/a/b"); verifyNamingEnumeration(enumObj, COUNT_LIMIT); } } --- old/test/jdk/com/sun/jndi/dns/FedTests/ListSubLeaf.java 2020-03-25 13:45:37.000000000 +0800 +++ new/test/jdk/com/sun/jndi/dns/FedTests/ListSubLeaf.java 2020-03-25 13:45:36.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,7 +54,7 @@ env().put(Context.OBJECT_FACTORIES, "FedObjectFactory"); setContext(new InitialDirContext(env())); - NamingEnumeration enumObj = context().listBindings(getKey() + "/a/b/c"); + NamingEnumeration enumObj = context().listBindings(getKey() + "/a/b/c"); verifyNamingEnumeration(enumObj, COUNT_LIMIT); } } --- old/test/jdk/com/sun/jndi/dns/ListTests/ListBindingsInteriorNotFound.java 2020-03-25 13:45:38.000000000 +0800 +++ new/test/jdk/com/sun/jndi/dns/ListTests/ListBindingsInteriorNotFound.java 2020-03-25 13:45:37.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,7 +52,7 @@ @Override public void runTest() throws Exception { setContext(new InitialDirContext(env())); - NamingEnumeration enumObj = context().listBindings(getKey()); + NamingEnumeration enumObj = context().listBindings(getKey()); DNSTestUtils.debug("Enum is: " + enumObj); throw new RuntimeException("Failed: expecting NameNotFoundException"); --- old/test/jdk/com/sun/jndi/dns/ListTests/ListBindingsLeafNotFound.java 2020-03-25 13:45:39.000000000 +0800 +++ new/test/jdk/com/sun/jndi/dns/ListTests/ListBindingsLeafNotFound.java 2020-03-25 13:45:39.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,7 +52,7 @@ @Override public void runTest() throws Exception { setContext(new InitialDirContext(env())); - NamingEnumeration enumObj = context().listBindings(getKey()); + NamingEnumeration enumObj = context().listBindings(getKey()); DNSTestUtils.debug("Enum is: " + enumObj); throw new RuntimeException("Failed: expecting NameNotFoundException"); --- old/test/jdk/com/sun/jndi/dns/ListTests/ListInteriorNotFound.java 2020-03-25 13:45:40.000000000 +0800 +++ new/test/jdk/com/sun/jndi/dns/ListTests/ListInteriorNotFound.java 2020-03-25 13:45:40.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,7 +52,7 @@ @Override public void runTest() throws Exception { setContext(new InitialDirContext(env())); - NamingEnumeration enumObj = context().list(getKey()); + NamingEnumeration enumObj = context().list(getKey()); DNSTestUtils.debug("Enum is: " + enumObj); throw new RuntimeException("Failed: expecting NameNotFoundException"); --- old/test/jdk/com/sun/jndi/dns/ListTests/ListLeafNotFound.java 2020-03-25 13:45:41.000000000 +0800 +++ new/test/jdk/com/sun/jndi/dns/ListTests/ListLeafNotFound.java 2020-03-25 13:45:41.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,7 +52,7 @@ @Override public void runTest() throws Exception { setContext(new InitialDirContext(env())); - NamingEnumeration enumObj = context().list(getKey()); + NamingEnumeration enumObj = context().list(getKey()); DNSTestUtils.debug("Enum is: " + enumObj); throw new RuntimeException("Failed: expecting NameNotFoundException"); --- old/test/jdk/com/sun/jndi/ldap/BalancedParentheses.java 2020-03-25 13:45:42.000000000 +0800 +++ new/test/jdk/com/sun/jndi/ldap/BalancedParentheses.java 2020-03-25 13:45:42.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -103,7 +103,7 @@ } // set up the environment for creating the initial context - Hashtable env = new Hashtable(); + Hashtable env = new Hashtable<>(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, "ldap://localhost:" + serverPort); @@ -121,7 +121,7 @@ scs.setSearchScope(SearchControls.SUBTREE_SCOPE); try { - NamingEnumeration answer = context.search( + NamingEnumeration answer = context.search( "o=sun,c=us", "(&(cn=Bob)))", scs); } catch (InvalidSearchFilterException isfe) { // ignore, it is the expected filter exception. @@ -132,7 +132,7 @@ } try { - NamingEnumeration answer = context.search( + NamingEnumeration answer = context.search( "o=sun,c=us", ")(&(cn=Bob)", scs); } catch (InvalidSearchFilterException isfe) { // ignore, it is the expected filter exception. @@ -143,7 +143,7 @@ } try { - NamingEnumeration answer = context.search( + NamingEnumeration answer = context.search( "o=sun,c=us", "(&(cn=Bob))", scs); } catch (InvalidSearchFilterException isfe) { // ignore, it is the expected filter exception. --- old/test/jdk/com/sun/jndi/ldap/Base64Test.java 2020-03-25 13:45:44.000000000 +0800 +++ new/test/jdk/com/sun/jndi/ldap/Base64Test.java 2020-03-25 13:45:43.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -180,7 +180,7 @@ * in an LDAP directory. */ private static void storeObjectInLDAP() { - Hashtable env = new Hashtable(); + Hashtable env = new Hashtable<>(); env.put(Context.REFERRAL, "follow"); // omit an LDAP control env.put("java.naming.ldap.version", "3"); // omit LDAP bind operation env.put("com.sun.jndi.ldap.trace.ber", System.err); // dump protocol --- old/test/jdk/com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java 2020-03-25 13:45:45.000000000 +0800 +++ new/test/jdk/com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java 2020-03-25 13:45:44.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,14 +52,14 @@ import static java.util.concurrent.TimeUnit.NANOSECONDS; -class DeadServerTimeoutSSLTest implements Callable { +class DeadServerTimeoutSSLTest implements Callable { - Hashtable env; + Hashtable env; DeadSSLServer server; boolean passed = false; private int HANGING_TEST_TIMEOUT = 20_000; - public DeadServerTimeoutSSLTest(Hashtable env) throws IOException { + public DeadServerTimeoutSSLTest(Hashtable env) throws IOException { this.server = new DeadSSLServer(); this.env = env; } @@ -106,7 +106,7 @@ public Boolean call() { InitialContext ctx = null; - ScheduledFuture killer = null; + ScheduledFuture killer = null; long start = System.nanoTime(); try { @@ -174,8 +174,8 @@ public class DeadSSLLdapTimeoutTest { - static Hashtable createEnv() { - Hashtable env = new Hashtable(11); + static Hashtable createEnv() { + Hashtable env = new Hashtable<>(11); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); return env; @@ -194,7 +194,7 @@ // this should exit with a SocketTimeoutException as the root cause // it should also use the connect timeout instead of the read timeout System.out.println("Running connect timeout test with 10ms connect timeout, 3000ms read timeout & SSL"); - Hashtable sslenv = createEnv(); + Hashtable sslenv = createEnv(); sslenv.put("com.sun.jndi.ldap.connect.timeout", "10"); sslenv.put("com.sun.jndi.ldap.read.timeout", "3000"); sslenv.put(Context.SECURITY_PROTOCOL, "ssl"); --- old/test/jdk/com/sun/jndi/ldap/InvalidLdapFilters.java 2020-03-25 13:45:46.000000000 +0800 +++ new/test/jdk/com/sun/jndi/ldap/InvalidLdapFilters.java 2020-03-25 13:45:46.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -207,7 +207,7 @@ scs.setSearchScope(SearchControls.SUBTREE_SCOPE); try { - NamingEnumeration answer = + NamingEnumeration answer = context.search("o=sun,c=us", searchFilter, scs); } catch (InvalidSearchFilterException isfe) { if (filterIsValid) { --- old/test/jdk/com/sun/jndi/ldap/LdapName/EmptyNameSearch.java 2020-03-25 13:45:47.000000000 +0800 +++ new/test/jdk/com/sun/jndi/ldap/LdapName/EmptyNameSearch.java 2020-03-25 13:45:47.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,7 @@ Thread.sleep(3000); // Setup JNDI parameters - Hashtable env = new Hashtable(); + Hashtable env = new Hashtable<>(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, "ldap://localhost:" + s.getPortNumber()); @@ -58,7 +58,7 @@ DirContext ctx = new InitialDirContext(env); System.out.println("Client: performing search..."); - ctx.search(new LdapName(Collections.EMPTY_LIST), "cn=*", null); + ctx.search(new LdapName(Collections.emptyList()), "cn=*", null); ctx.close(); // Exit --- old/test/jdk/com/sun/jndi/ldap/NoWaitForReplyTest.java 2020-03-25 13:45:48.000000000 +0800 +++ new/test/jdk/com/sun/jndi/ldap/NoWaitForReplyTest.java 2020-03-25 13:45:48.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ ldapServer.start(); // Set up the environment for creating the initial context - Hashtable env = new Hashtable(11); + Hashtable env = new Hashtable<>(11); env.put(Context.PROVIDER_URL, "ldap://localhost:" + ldapServer.getPortNumber()); env.put(Context.INITIAL_CONTEXT_FACTORY, @@ -70,7 +70,7 @@ SearchControls scl = new SearchControls(); scl.setSearchScope(SearchControls.SUBTREE_SCOPE); System.out.println("Client: performing search"); - NamingEnumeration answer = + NamingEnumeration answer = ctx.search("ou=People,o=JNDITutorial", "(objectClass=*)", scl); // Server will never reply: either we waited in the call above until --- old/test/jdk/com/sun/jndi/ldap/blits/AddTests/AddNewEntry.java 2020-03-25 13:45:49.000000000 +0800 +++ new/test/jdk/com/sun/jndi/ldap/blits/AddTests/AddNewEntry.java 2020-03-25 13:45:49.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -99,7 +99,7 @@ SearchControls constraints = new SearchControls(); constraints.setSearchScope(SearchControls.OBJECT_SCOPE); - NamingEnumeration results = ctx + NamingEnumeration results = ctx .search(entryDN, "(objectclass=*)", constraints); int found = LDAPTestUtils.checkResult(results, expect); --- old/test/jdk/javax/naming/InitialContext/EnvClone.java 2020-03-25 13:45:51.000000000 +0800 +++ new/test/jdk/javax/naming/InitialContext/EnvClone.java 2020-03-25 13:45:50.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ public static void main(String[] args) throws Exception { - Hashtable env = new Hashtable(5); + Hashtable env = new Hashtable<>(5); EnvClone ctx = new EnvClone(env); if (env == ctx.myProps) { --- old/test/jdk/javax/naming/ldap/LdapName/CompareToEqualsTests.java 2020-03-25 13:45:52.000000000 +0800 +++ new/test/jdk/javax/naming/ldap/LdapName/CompareToEqualsTests.java 2020-03-25 13:45:51.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -74,12 +74,12 @@ byte[] value = "abcxyz".getBytes(); Rdn rdn1 = new Rdn("binary", value); - ArrayList rdns1 = new ArrayList(); + ArrayList rdns1 = new ArrayList<>(); rdns1.add(rdn1); LdapName l1 = new LdapName(rdns1); Rdn rdn2 = new Rdn("binary", value); - ArrayList rdns2 = new ArrayList(); + ArrayList rdns2 = new ArrayList<>(); rdns2.add(rdn2); LdapName l2 = new LdapName(rdns2); checkResults(l1, l2, 0); --- old/test/jdk/javax/naming/ldap/LdapName/LdapNameConstruction.java 2020-03-25 13:45:53.000000000 +0800 +++ new/test/jdk/javax/naming/ldap/LdapName/LdapNameConstruction.java 2020-03-25 13:45:53.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,7 +66,7 @@ /** * LdapName creation tests */ - List rdns = new ArrayList(); + List rdns = new ArrayList<>(); rdns.add(new Rdn("o=Food")); rdns.add(new Rdn("ou=Fruits")); rdns.add(rdn3); @@ -82,7 +82,7 @@ } System.out.println("ldapname1 and ldapname2 are equal"); - LdapName name = new LdapName(new ArrayList()); + LdapName name = new LdapName(new ArrayList<>()); System.out.println("Empty ldapname:" + name); } } --- old/test/jdk/javax/naming/ldap/LdapName/NameTests.java 2020-03-25 13:45:54.000000000 +0800 +++ new/test/jdk/javax/naming/ldap/LdapName/NameTests.java 2020-03-25 13:45:54.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,25 +42,25 @@ String[] rdnStr = new String[] {"one=voilet"}; - ArrayList rdnList = new ArrayList(); + ArrayList rdnList = new ArrayList<>(); for (int i = 0; i < rdnStr.length; i++) { rdnList.add(i, new Rdn(rdnStr[i])); } LdapName dn = new LdapName(rdnList); - Collection rdns = dn.getRdns(); + Collection rdns = dn.getRdns(); System.out.println("size is :" + dn.size()); System.out.println("isEmpty :" + dn.isEmpty()); System.out.println("************Printing as Rdns*********"); - Iterator iter = rdns.iterator(); + Iterator iter = rdns.iterator(); while (iter.hasNext()) { System.out.println(iter.next()); } System.out.println(); System.out.println("************Printing the Enumeration*********"); - Enumeration dnEnum = dn.getAll(); + Enumeration dnEnum = dn.getAll(); while (dnEnum.hasMoreElements()) { System.out.println(dnEnum.nextElement()); } @@ -70,7 +70,7 @@ LdapName nameSuffix = new LdapName("two=Indigo"); System.out.println("addAll():" + dn.addAll(nameSuffix)); - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); list.add(new Rdn("five=Yellow")); System.out.println("Rdn- addAll():" + dn.addAll(list)); @@ -79,7 +79,7 @@ System.out.println("addAll at pos = 2"); System.out.println("addAll():" + dn.addAll(2, nameSuffix)); - list = new ArrayList(); + list = new ArrayList<>(); list.add(new Rdn("four=Green")); System.out.println(); System.out.println("addAll at pos = 3"); @@ -146,12 +146,12 @@ rdnStr[0] + "): " + dn.startsWith( new CompositeName(rdnStr[0]))); - java.util.List prefixList = (dn.getRdns()).subList(0, size /2); + List prefixList = (dn.getRdns()).subList(0, size /2); System.out.println("Rdn - startsWith(" + prefixList + "):" + dn.startsWith(prefixList)); System.out.println("Rdn - startsWith() - empty RDN list:" + - dn.startsWith(new ArrayList())); + dn.startsWith(new ArrayList<>())); System.out.println(); System.out.println("endsWith(" + rdnStr[0] + "):" + @@ -167,7 +167,7 @@ dn.endsWith(prefixList)); System.out.println("Rdn - endsWith() empty RDN list:" + - dn.endsWith(new ArrayList())); + dn.endsWith(new ArrayList<>())); // test clone System.out.println(); --- old/test/jdk/javax/naming/spi/DirectoryManager/DummyContext.java 2020-03-25 13:45:55.000000000 +0800 +++ new/test/jdk/javax/naming/spi/DirectoryManager/DummyContext.java 2020-03-25 13:45:55.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,13 +31,13 @@ public class DummyContext extends InitialContext { - private Hashtable env; + private Hashtable env; - DummyContext(Hashtable env) throws NamingException { + DummyContext(Hashtable env) throws NamingException { this.env = env; } - public Hashtable getEnvironment() throws NamingException { + public Hashtable getEnvironment() throws NamingException { return env; } } --- old/test/jdk/javax/naming/spi/DirectoryManager/GetContDirCtx.java 2020-03-25 13:45:56.000000000 +0800 +++ new/test/jdk/javax/naming/spi/DirectoryManager/GetContDirCtx.java 2020-03-25 13:45:56.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,7 @@ public static void main(String[] args) throws Exception { CannotProceedException cpe = new CannotProceedException(); - Hashtable env = new Hashtable(1); + Hashtable env = new Hashtable<>(1); cpe.setEnvironment(env); Reference ref = new Reference("java.lang.Object", @@ -52,7 +52,7 @@ } catch (CannotProceedException e) { } - Hashtable contEnv = contCtx.getEnvironment(); + Hashtable contEnv = contCtx.getEnvironment(); if (contEnv.get(NamingManager.CPE) != cpe) { throw new Exception("Test failed: CPE property not set" + " in the continuation context"); --- old/test/jdk/javax/naming/spi/DummyContextFactory.java 2020-03-25 13:45:58.000000000 +0800 +++ new/test/jdk/javax/naming/spi/DummyContextFactory.java 2020-03-25 13:45:57.000000000 +0800 @@ -126,13 +126,13 @@ public class DummyContext extends InitialContext { - private Hashtable env; + private Hashtable env; - DummyContext(Hashtable env) throws NamingException { + DummyContext(Hashtable env) throws NamingException { this.env = env; } - public Hashtable getEnvironment() { + public Hashtable getEnvironment() { return env; } } --- old/test/jdk/javax/naming/spi/DummyContextFactory2.java 2020-03-25 13:45:59.000000000 +0800 +++ new/test/jdk/javax/naming/spi/DummyContextFactory2.java 2020-03-25 13:45:58.000000000 +0800 @@ -42,13 +42,13 @@ public class DummyContext extends InitialContext { - private Hashtable env; + private Hashtable env; - DummyContext(Hashtable env) throws NamingException { + DummyContext(Hashtable env) throws NamingException { this.env = env; } - public Hashtable getEnvironment() { + public Hashtable getEnvironment() { return env; } }