Skip to content
Permalink
Browse files

8214694: cleanup rawtypes warnings in open jndi tests

Reviewed-by: darcy, vtewari
  • Loading branch information
Chris Yin committed Apr 1, 2020
1 parent 35f4df5 commit aba017fa70011d7fa14de07d4c9db1932eeff0f9
Showing with 101 additions and 93 deletions.
  1. +2 −2 test/jdk/com/sun/jndi/dns/CheckAccess.java
  2. +3 −3 test/jdk/com/sun/jndi/dns/EnvTests/AddInherited.java
  3. +3 −3 test/jdk/com/sun/jndi/dns/EnvTests/GetEnv.java
  4. +3 −3 test/jdk/com/sun/jndi/dns/EnvTests/RemoveInherited.java
  5. +3 −3 test/jdk/com/sun/jndi/dns/EnvTests/SubcontextAdd.java
  6. +3 −3 test/jdk/com/sun/jndi/dns/EnvTests/SubcontextRemove.java
  7. +2 −2 test/jdk/com/sun/jndi/dns/FactoryTests/TestDnsObject.java
  8. +3 −3 test/jdk/com/sun/jndi/dns/FedTests/ListFedBase.java
  9. +3 −2 test/jdk/com/sun/jndi/dns/FedTests/ListNns.java
  10. +3 −2 test/jdk/com/sun/jndi/dns/FedTests/ListSubInterior.java
  11. +3 −2 test/jdk/com/sun/jndi/dns/FedTests/ListSubLeaf.java
  12. +3 −2 test/jdk/com/sun/jndi/dns/ListTests/ListBindingsInteriorNotFound.java
  13. +3 −2 test/jdk/com/sun/jndi/dns/ListTests/ListBindingsLeafNotFound.java
  14. +3 −2 test/jdk/com/sun/jndi/dns/ListTests/ListInteriorNotFound.java
  15. +3 −2 test/jdk/com/sun/jndi/dns/ListTests/ListLeafNotFound.java
  16. +5 −5 test/jdk/com/sun/jndi/ldap/BalancedParentheses.java
  17. +2 −2 test/jdk/com/sun/jndi/ldap/Base64Test.java
  18. +8 −8 test/jdk/com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java
  19. +2 −2 test/jdk/com/sun/jndi/ldap/InvalidLdapFilters.java
  20. +3 −3 test/jdk/com/sun/jndi/ldap/LdapName/EmptyNameSearch.java
  21. +3 −3 test/jdk/com/sun/jndi/ldap/NoWaitForReplyTest.java
  22. +3 −2 test/jdk/com/sun/jndi/ldap/blits/AddTests/AddNewEntry.java
  23. +3 −3 test/jdk/javax/naming/InitialContext/EnvClone.java
  24. +3 −3 test/jdk/javax/naming/ldap/LdapName/CompareToEqualsTests.java
  25. +3 −3 test/jdk/javax/naming/ldap/LdapName/LdapNameConstruction.java
  26. +10 −10 test/jdk/javax/naming/ldap/LdapName/NameTests.java
  27. +4 −4 test/jdk/javax/naming/spi/DirectoryManager/DummyContext.java
  28. +3 −3 test/jdk/javax/naming/spi/DirectoryManager/GetContDirCtx.java
  29. +3 −3 test/jdk/javax/naming/spi/DummyContextFactory.java
  30. +3 −3 test/jdk/javax/naming/spi/DummyContextFactory2.java
@@ -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(
@@ -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 @@ public static void main(String[] args) throws Exception {

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);
@@ -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 @@ public static void main(String[] args) throws Exception {

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);
@@ -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 @@ public static void main(String[] args) throws Exception {

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);
@@ -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 @@ public static void main(String[] args) throws Exception {
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);
@@ -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 @@ public static void main(String[] args) throws Exception {
+ 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);
@@ -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());
}
@@ -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,15 +46,15 @@ public ListFedBase() {
* @param expectedCount given expected count
* @throws NamingException
*/
public void verifyNamingEnumeration(NamingEnumeration enumObj,
public void verifyNamingEnumeration(NamingEnumeration<Binding> enumObj,
int expectedCount) throws NamingException {
DNSTestUtils.debug("Enum is: " + enumObj);

int count = 0;
Binding res;

while (enumObj.hasMore()) {
res = (Binding) enumObj.next();
res = enumObj.next();
DNSTestUtils.debug(res);
++count;
}
@@ -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
@@ -21,6 +21,7 @@
* questions.
*/

import javax.naming.Binding;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.naming.directory.InitialDirContext;
@@ -52,7 +53,7 @@ public void runTest() throws Exception {
env().put(Context.OBJECT_FACTORIES, "FedObjectFactory");
setContext(new InitialDirContext(env()));

NamingEnumeration enumObj = context().listBindings(getKey() + "/");
NamingEnumeration<Binding> enumObj = context().listBindings(getKey() + "/");
verifyNamingEnumeration(enumObj, COUNT_LIMIT);
}
}
@@ -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
@@ -21,6 +21,7 @@
* questions.
*/

import javax.naming.Binding;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.naming.directory.InitialDirContext;
@@ -54,7 +55,7 @@ public void runTest() throws Exception {
env().put(Context.OBJECT_FACTORIES, "FedObjectFactory");
setContext(new InitialDirContext(env()));

NamingEnumeration enumObj = context().listBindings(getKey() + "/a/b");
NamingEnumeration<Binding> enumObj = context().listBindings(getKey() + "/a/b");
verifyNamingEnumeration(enumObj, COUNT_LIMIT);
}
}
@@ -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
@@ -21,6 +21,7 @@
* questions.
*/

import javax.naming.Binding;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.naming.directory.InitialDirContext;
@@ -54,7 +55,7 @@ public void runTest() throws Exception {
env().put(Context.OBJECT_FACTORIES, "FedObjectFactory");
setContext(new InitialDirContext(env()));

NamingEnumeration enumObj = context().listBindings(getKey() + "/a/b/c");
NamingEnumeration<Binding> enumObj = context().listBindings(getKey() + "/a/b/c");
verifyNamingEnumeration(enumObj, COUNT_LIMIT);
}
}
@@ -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
@@ -21,6 +21,7 @@
* questions.
*/

import javax.naming.Binding;
import javax.naming.NameNotFoundException;
import javax.naming.NamingEnumeration;
import javax.naming.directory.InitialDirContext;
@@ -52,7 +53,7 @@ public static void main(String[] args) throws Exception {
@Override
public void runTest() throws Exception {
setContext(new InitialDirContext(env()));
NamingEnumeration enumObj = context().listBindings(getKey());
NamingEnumeration<Binding> enumObj = context().listBindings(getKey());

DNSTestUtils.debug("Enum is: " + enumObj);
throw new RuntimeException("Failed: expecting NameNotFoundException");
@@ -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
@@ -21,6 +21,7 @@
* questions.
*/

import javax.naming.Binding;
import javax.naming.NameNotFoundException;
import javax.naming.NamingEnumeration;
import javax.naming.directory.InitialDirContext;
@@ -52,7 +53,7 @@ public static void main(String[] args) throws Exception {
@Override
public void runTest() throws Exception {
setContext(new InitialDirContext(env()));
NamingEnumeration enumObj = context().listBindings(getKey());
NamingEnumeration<Binding> enumObj = context().listBindings(getKey());

DNSTestUtils.debug("Enum is: " + enumObj);
throw new RuntimeException("Failed: expecting NameNotFoundException");
@@ -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
@@ -21,6 +21,7 @@
* questions.
*/

import javax.naming.NameClassPair;
import javax.naming.NameNotFoundException;
import javax.naming.NamingEnumeration;
import javax.naming.directory.InitialDirContext;
@@ -52,7 +53,7 @@ public static void main(String[] args) throws Exception {
@Override
public void runTest() throws Exception {
setContext(new InitialDirContext(env()));
NamingEnumeration enumObj = context().list(getKey());
NamingEnumeration<NameClassPair> enumObj = context().list(getKey());

DNSTestUtils.debug("Enum is: " + enumObj);
throw new RuntimeException("Failed: expecting NameNotFoundException");
@@ -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
@@ -21,6 +21,7 @@
* questions.
*/

import javax.naming.NameClassPair;
import javax.naming.NameNotFoundException;
import javax.naming.NamingEnumeration;
import javax.naming.directory.InitialDirContext;
@@ -52,7 +53,7 @@ public static void main(String[] args) throws Exception {
@Override
public void runTest() throws Exception {
setContext(new InitialDirContext(env()));
NamingEnumeration enumObj = context().list(getKey());
NamingEnumeration<NameClassPair> enumObj = context().list(getKey());

DNSTestUtils.debug("Enum is: " + enumObj);
throw new RuntimeException("Failed: expecting NameNotFoundException");
@@ -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 @@ void doClientSide() throws Exception {
}

// set up the environment for creating the initial context
Hashtable<Object, Object> env = new Hashtable<Object, Object>();
Hashtable<Object, Object> 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 @@ void doClientSide() throws Exception {
scs.setSearchScope(SearchControls.SUBTREE_SCOPE);

try {
NamingEnumeration answer = context.search(
NamingEnumeration<SearchResult> answer = context.search(
"o=sun,c=us", "(&(cn=Bob)))", scs);
} catch (InvalidSearchFilterException isfe) {
// ignore, it is the expected filter exception.
@@ -132,7 +132,7 @@ void doClientSide() throws Exception {
}

try {
NamingEnumeration answer = context.search(
NamingEnumeration<SearchResult> answer = context.search(
"o=sun,c=us", ")(&(cn=Bob)", scs);
} catch (InvalidSearchFilterException isfe) {
// ignore, it is the expected filter exception.
@@ -143,7 +143,7 @@ void doClientSide() throws Exception {
}

try {
NamingEnumeration answer = context.search(
NamingEnumeration<SearchResult> answer = context.search(
"o=sun,c=us", "(&(cn=Bob))", scs);
} catch (InvalidSearchFilterException isfe) {
// ignore, it is the expected filter exception.
@@ -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 @@ private static void deserialize(byte[] bytes) throws Exception {
* in an LDAP directory.
*/
private static void storeObjectInLDAP() {
Hashtable env = new Hashtable();
Hashtable<Object, Object> 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

0 comments on commit aba017f

Please sign in to comment.